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.")]
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");
41 var testingTarget = new Hover();
42 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
43 Assert.IsInstanceOf<Hover>(testingTarget, "Should be an instance of Hover type.");
45 testingTarget.Dispose();
46 tlog.Debug(tag, $"HoverConstructor END (OK)");
47 Assert.Pass("HoverConstructor");
52 [Description("Create a Hover object.")]
53 [Property("SPEC", "Tizen.NUI.Hover.Hover C")]
54 [Property("SPEC_URL", "-")]
55 [Property("CRITERIA", "CONSTR")]
56 [Property("COVPARAM", "")]
57 [Property("AUTHOR", "guowei.wang@samsung.com")]
58 public void HoverConstructorWithTime()
60 tlog.Debug(tag, $"HoverConstructorWithTime START");
62 var testingTarget = new Hover(300);
63 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
64 Assert.IsInstanceOf<Hover>(testingTarget, "Should be an instance of Hover type.");
66 testingTarget.Dispose();
67 tlog.Debug(tag, $"HoverConstructorWithTime END (OK)");
68 Assert.Pass("HoverConstructor");
73 [Description("Create a Hover object.")]
74 [Property("SPEC", "Tizen.NUI.Hover.Hover C")]
75 [Property("SPEC_URL", "-")]
76 [Property("CRITERIA", "CONSTR")]
77 [Property("COVPARAM", "")]
78 [Property("AUTHOR", "guowei.wang@samsung.com")]
79 public void HoverConstructorWithHover()
81 tlog.Debug(tag, $"HoverConstructorWithHover START");
83 using (Hover hover = new Hover(300))
85 var testingTarget = new Hover(hover);
86 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
87 Assert.IsInstanceOf<Hover>(testingTarget, "Should be an instance of Hover type.");
89 testingTarget.Dispose();
92 tlog.Debug(tag, $"HoverConstructorWithHover END (OK)");
93 Assert.Pass("HoverConstructor");
98 [Description("Test Time property.")]
99 [Property("SPEC", "Tizen.NUI.Hover.Time A")]
100 [Property("SPEC_URL", "-")]
101 [Property("CRITERIA", "PRW")]
102 [Property("AUTHOR", "guowei.wang@samsung.com")]
103 public void HoverTime()
105 tlog.Debug(tag, $"HoverTime START");
107 var testingTarget = new Hover();
108 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
109 Assert.IsInstanceOf<Hover>(testingTarget, "Should be an instance of Hover type.");
111 tlog.Debug(tag, "time : " + testingTarget.Time);
113 testingTarget.Dispose();
114 tlog.Debug(tag, $"HoverTime END (OK)");
115 Assert.Pass("HoverTime");
120 [Description("Test GetDeviceId.")]
121 [Property("SPEC", "Tizen.NUI.Hover.GetDeviceId M")]
122 [Property("SPEC_URL", "-")]
123 [Property("CRITERIA", "MR")]
124 [Property("AUTHOR", "guowei.wang@samsung.com")]
125 public void HoverGetDeviceId()
127 tlog.Debug(tag, $"HoverGetDeviceId START");
129 var testingTarget = new Hover();
130 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
131 Assert.IsInstanceOf<Hover>(testingTarget, "Should be an instance of Hover type.");
133 tlog.Debug(tag, "DeviceId : " + testingTarget.GetDeviceId(0));
135 testingTarget.Dispose();
136 tlog.Debug(tag, $"HoverGetDeviceId END (OK)");
137 Assert.Pass("HoverGetDeviceId");
142 [Description("Test GetState.")]
143 [Property("SPEC", "Tizen.NUI.Hover.GetState M")]
144 [Property("SPEC_URL", "-")]
145 [Property("CRITERIA", "MR")]
146 [Property("AUTHOR", "guowei.wang@partner.samsung.com")]
147 public void HoverGetState()
149 tlog.Debug(tag, $"HoverGetState START");
151 var testingTarget = new Hover();
152 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
153 Assert.IsInstanceOf<Hover>(testingTarget, "Should be an instance of Hover type.");
155 tlog.Debug(tag, "State : " + testingTarget.GetState(0));
157 testingTarget.Dispose();
158 tlog.Debug(tag, $"HoverGetState END (OK)");
159 Assert.Pass("HoverGetState");
164 [Description("Test GetHitView.")]
165 [Property("SPEC", "Tizen.NUI.Hover.GetHitView M")]
166 [Property("SPEC_URL", "-")]
167 [Property("CRITERIA", "MR")]
168 [Property("AUTHOR", "guowei.wang@samsung.com")]
169 public void HoverGetHitView()
171 tlog.Debug(tag, $"HoverGetHitView START");
173 var testingTarget = new Hover();
174 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
175 Assert.IsInstanceOf<Hover>(testingTarget, "Should be an instance of Hover type.");
177 tlog.Debug(tag, "HitView : " + testingTarget.GetHitView(0));
179 testingTarget.Dispose();
180 tlog.Debug(tag, $"HoverGetHitView END (OK)");
181 Assert.Pass("HoverGetHitView");
186 [Description("Test GetLocalPosition.")]
187 [Property("SPEC", "Tizen.NUI.Hover.GetLocalPosition M")]
188 [Property("SPEC_URL", "-")]
189 [Property("CRITERIA", "MR")]
190 [Property("AUTHOR", "guowei.wang@samsung.com")]
191 public void HoverGetLocalPosition()
193 tlog.Debug(tag, $"HoverGetLocalPosition START");
195 var testingTarget = new Hover();
196 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
197 Assert.IsInstanceOf<Hover>(testingTarget, "Should be an instance of Hover type.");
199 Assert.AreEqual(0.0f, testingTarget.GetLocalPosition(0).X, "Should be equals to the origin value of LocalPosition.X");
200 Assert.AreEqual(0.0f, testingTarget.GetLocalPosition(0).Y, "Should be equals to the origin value of LocalPosition.Y");
202 testingTarget.Dispose();
203 tlog.Debug(tag, $"HoverGetLocalPosition END (OK)");
204 Assert.Pass("HoverGetLocalPosition");
209 [Description("Test GetScreenPosition.")]
210 [Property("SPEC", "Tizen.NUI.Hover.GetScreenPosition M")]
211 [Property("SPEC_URL", "-")]
212 [Property("CRITERIA", "MR")]
213 [Property("AUTHOR", "guowei.wang@samsung.com")]
214 public void HoverGetScreenPosition()
216 tlog.Debug(tag, $"HoverGetScreenPosition START");
218 var testingTarget = new Hover();
219 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
220 Assert.IsInstanceOf<Hover>(testingTarget, "Should be an instance of Hover type.");
222 Assert.AreEqual(0.0f, testingTarget.GetScreenPosition(0).X, "Should be equals to the origin value of ScreenPosition.X");
223 Assert.AreEqual(0.0f, testingTarget.GetScreenPosition(0).Y, "Should be equals to the origin value of ScreenPosition.Y");
225 testingTarget.Dispose();
226 tlog.Debug(tag, $"HoverGetScreenPosition END (OK)");
227 Assert.Pass("HoverGetScreenPosition");
232 [Description("Test GetPointCount.")]
233 [Property("SPEC", "Tizen.NUI.Hover.GetPointCount M")]
234 [Property("SPEC_URL", "-")]
235 [Property("CRITERIA", "MR")]
236 [Property("AUTHOR", "guowei.wang@samsung.com")]
237 public void HoverGetPointCount()
239 tlog.Debug(tag, $"HoverGetPointCount START");
241 var testingTarget = new Hover();
242 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
243 Assert.IsInstanceOf<Hover>(testingTarget, "Should be an instance of Hover type.");
245 tlog.Debug(tag, "PointCount : " + testingTarget.GetPointCount());
247 tlog.Debug(tag, $"HoverGetPointCount END (OK)");
248 Assert.Pass("HoverGetPointCount");
253 [Description("Test GetCPtr.")]
254 [Property("SPEC", "Tizen.NUI.Hover.GetCPtr M")]
255 [Property("SPEC_URL", "-")]
256 [Property("CRITERIA", "MR")]
257 [Property("AUTHOR", "guowei.wang@samsung.com")]
258 public void HoverGetCPtr()
260 tlog.Debug(tag, $"HoverGetCPtr START");
262 using (Hover hover = new Hover())
266 Hover.getCPtr(hover);
270 tlog.Debug(tag, e.Message.ToString());
271 Assert.Fail("Caught Exception : Failed!");
275 tlog.Debug(tag, $"HoverGetCPtr END (OK)");
276 Assert.Pass("HoverGetCPtr");
281 [Description("Test GetHoverFromPtr.")]
282 [Property("SPEC", "Tizen.NUI.Hover.GetHoverFromPtr M")]
283 [Property("SPEC_URL", "-")]
284 [Property("CRITERIA", "MR")]
285 [Property("AUTHOR", "guowei.wang@samsung.com")]
286 public void HoverGetHoverFromPtr()
288 tlog.Debug(tag, $"HoverGetHoverFromPtr START");
290 using (Hover hover = new Hover(300))
292 var testingTarget = Hover.GetHoverFromPtr(Hover.getCPtr(hover).Handle);
293 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
294 Assert.IsInstanceOf<Hover>(testingTarget, "Should be an instance of Hover type.");
296 testingTarget.Dispose();
299 tlog.Debug(tag, $"HoverGetHoverFromPtr END (OK)");
300 Assert.Pass("HoverGetHoverFromPtr");