1 using NUnit.Framework;
2 using NUnit.Framework.TUnit;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("public/Events/Hover")]
13 internal class PublicHoverTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("Create a Hover object. Check whether Hover is successfully created or not.")]
32 [Property("SPEC", "Tizen.NUI.Hover.Hover C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("COVPARAM", "")]
36 [Property("AUTHOR", "guowei.wang@samsung.com")]
37 public void HoverConstructor()
39 tlog.Debug(tag, $"HoverConstructor START");
40 var hover1 = new Hover();
41 Assert.IsNotNull(hover1, "Can't create success object Hover");
42 Assert.IsInstanceOf<Hover>(hover1, "Should be an instance of Hover type.");
44 var hover2 = new Hover(2);
46 var hover3 = new Hover(hover2);
48 var hover4 = new Hover(Hover.getCPtr(hover3).Handle, true);
54 tlog.Debug(tag, $"HoverConstructor END (OK)");
55 Assert.Pass("HoverConstructor");
60 [Description("Test Time property. Check whether Time returns the value expected.")]
61 [Property("SPEC", "Tizen.NUI.Hover.Time A")]
62 [Property("SPEC_URL", "-")]
63 [Property("CRITERIA", "PRW")]
64 [Property("AUTHOR", "guowei.wang@samsung.com")]
65 public void HoverTime()
67 tlog.Debug(tag, $"HoverTime START");
69 Hover hover = new Hover();
70 Assert.AreEqual(0u, hover.Time, "Should be equals to the origin value of Time");
72 tlog.Debug(tag, $"HoverTime END (OK)");
73 Assert.Pass("HoverTime");
78 [Description("Test GetDeviceId.Check whether GetDeviceId returns the value expected.")]
79 [Property("SPEC", "Tizen.NUI.Hover.GetDeviceId M")]
80 [Property("SPEC_URL", "-")]
81 [Property("CRITERIA", "MR")]
82 [Property("AUTHOR", "guowei.wang@samsung.com")]
83 public void HoverGetDeviceId()
85 tlog.Debug(tag, $"HoverGetDeviceId START");
87 Hover hover = new Hover();
88 Assert.AreEqual(-1, hover.GetDeviceId(0), "Should be equals to the origin value of DeviceId");
90 tlog.Debug(tag, $"HoverGetDeviceId END (OK)");
91 Assert.Pass("HoverGetDeviceId");
96 [Description("Test GetState.Check whether GetState returns the value expected.")]
97 [Property("SPEC", "Tizen.NUI.Hover.GetState M")]
98 [Property("SPEC_URL", "-")]
99 [Property("CRITERIA", "MR")]
100 [Property("AUTHOR", "guowei.wang@partner.samsung.com")]
101 public void HoverGetState()
103 tlog.Debug(tag, $"HoverGetState START");
105 Hover hover = new Hover();
106 Assert.AreEqual(PointStateType.Finished, hover.GetState(0), "Should be equals to the origin value of state");
108 tlog.Debug(tag, $"HoverGetState END (OK)");
109 Assert.Pass("HoverGetState");
114 [Description("Test GetHitView.Check whether GetHitView returns the value expected.")]
115 [Property("SPEC", "Tizen.NUI.Hover.GetHitView M")]
116 [Property("SPEC_URL", "-")]
117 [Property("CRITERIA", "MR")]
118 [Property("AUTHOR", "guowei.wang@samsung.com")]
119 public void HoverGetHitView()
121 tlog.Debug(tag, $"HoverGetHitView START");
123 Hover hover = new Hover();
125 Assert.IsNotInstanceOf<View>(hover.GetHitView(0), "non-existent point returns an empty handle");
127 tlog.Debug(tag, $"HoverGetHitView END (OK)");
128 Assert.Pass("HoverGetHitView");
133 [Description("Test GetLocalPosition.Check whether GetLocalPosition returns the value expected.")]
134 [Property("SPEC", "Tizen.NUI.Hover.GetLocalPosition M")]
135 [Property("SPEC_URL", "-")]
136 [Property("CRITERIA", "MR")]
137 [Property("AUTHOR", "guowei.wang@samsung.com")]
138 public void HoverGetLocalPosition()
140 tlog.Debug(tag, $"HoverGetLocalPosition START");
142 Hover hover = new Hover();
143 Assert.AreEqual(0.0f, hover.GetLocalPosition(0).X, "Should be equals to the origin value of LocalPosition.X");
144 Assert.AreEqual(0.0f, hover.GetLocalPosition(0).Y, "Should be equals to the origin value of LocalPosition.Y");
146 tlog.Debug(tag, $"HoverGetLocalPosition END (OK)");
147 Assert.Pass("HoverGetLocalPosition");
152 [Description("Test GetScreenPosition.Check whether GetScreenPosition returns the value expected.")]
153 [Property("SPEC", "Tizen.NUI.Hover.GetScreenPosition M")]
154 [Property("SPEC_URL", "-")]
155 [Property("CRITERIA", "MR")]
156 [Property("AUTHOR", "guowei.wang@samsung.com")]
157 public void HoverGetScreenPosition()
159 tlog.Debug(tag, $"HoverGetScreenPosition START");
161 Hover hover = new Hover();
162 Assert.AreEqual(0.0f, hover.GetScreenPosition(0).X, "Should be equals to the origin value of ScreenPosition.X");
163 Assert.AreEqual(0.0f, hover.GetScreenPosition(0).Y, "Should be equals to the origin value of ScreenPosition.Y");
165 tlog.Debug(tag, $"HoverGetScreenPosition END (OK)");
166 Assert.Pass("HoverGetScreenPosition");
171 [Description("Test GetPointCount.Check whether GetPointCount returns the value expected.")]
172 [Property("SPEC", "Tizen.NUI.Hover.GetPointCount M")]
173 [Property("SPEC_URL", "-")]
174 [Property("CRITERIA", "MR")]
175 [Property("AUTHOR", "guowei.wang@samsung.com")]
176 public void HoverGetPointCount()
178 tlog.Debug(tag, $"HoverGetPointCount START");
180 Hover hover = new Hover();
181 Assert.AreEqual(0, hover.GetPointCount(), "Should be equals to the origin value of pointCount");
182 tlog.Debug(tag, $"HoverGetPointCount END (OK)");
183 Assert.Pass("HoverGetPointCount");
188 [Description("Test GetCPtr.")]
189 [Property("SPEC", "Tizen.NUI.Hover.GetCPtr M")]
190 [Property("SPEC_URL", "-")]
191 [Property("CRITERIA", "MR")]
192 [Property("AUTHOR", "guowei.wang@samsung.com")]
193 public void HoverGetCPtr()
195 tlog.Debug(tag, $"HoverGetCPtr START");
196 Hover hover = new Hover();
197 Hover.getCPtr(hover);
198 Assert.Pass("HoverGetCPtr");
199 tlog.Debug(tag, $"HoverGetCPtr END (OK)");
200 Assert.Pass("HoverGetCPtr");
205 [Description("Test GetHoverFromPtr.")]
206 [Property("SPEC", "Tizen.NUI.Hover.GetHoverFromPtr M")]
207 [Property("SPEC_URL", "-")]
208 [Property("CRITERIA", "MR")]
209 [Property("AUTHOR", "guowei.wang@samsung.com")]
210 public void HoverGetHoverFromPtr()
212 tlog.Debug(tag, $"HoverGetHoverFromPtr START");
213 var hover2 = new Hover(2);
215 Hover hover = Hover.GetHoverFromPtr(Hover.getCPtr(hover2).Handle);
216 Assert.Pass("HoverGetHoverFromPtr");
220 tlog.Debug(tag, $"HoverGetHoverFromPtr END (OK)");
221 Assert.Pass("HoverGetHoverFromPtr");