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/Touch")]
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("Touch constructor")]
32 [Property("SPEC", "Tizen.NUI.Touch.Touch C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void TouchConstructor()
38 tlog.Debug(tag, $"TouchConstructor START");
40 var testingTarget = new Touch();
41 Assert.IsNotNull(testingTarget, "Can't create success object Touch");
42 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
44 testingTarget.Dispose();
45 tlog.Debug(tag, $"TouchConstructor END (OK)");
46 Assert.Pass("TouchConstructor");
51 //[Description("Touch constructor")]
52 //[Property("SPEC", "Tizen.NUI.Touch.Touch C")]
53 //[Property("SPEC_URL", "-")]
54 //[Property("CRITERIA", "CONSTR")]
55 //[Property("AUTHOR", "guowei.wang@samsung.com")]
56 //public void TouchConstructorWithTouch()
58 // tlog.Debug(tag, $"TouchConstructorWithTouch START");
60 // using (Touch touch = new Touch())
62 // var testingTarget = new Touch(touch);
63 // Assert.IsNotNull(testingTarget, "Can't create success object Touch");
64 // Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
66 // testingTarget.Dispose();
69 // tlog.Debug(tag, $"TouchConstructorWithTouch END (OK)");
70 // Assert.Pass("TouchConstructor");
75 //[Description("Touch GetTime")]
76 //[Property("SPEC", "Tizen.NUI.Touch.GetTime M")]
77 //[Property("SPEC_URL", "-")]
78 //[Property("CRITERIA", "MR")]
79 //[Property("AUTHOR", "guowei.wang@samsung.com")]
80 //public void TouchGetTime()
82 // tlog.Debug(tag, $"TouchGetTime START");
84 // var testingTarget = new Touch();
85 // Assert.IsNotNull(testingTarget, "Can't create success object Touch");
86 // Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
90 // testingTarget.GetTime();
92 // catch (Exception e)
94 // tlog.Debug(tag, e.Message.ToString());
95 // Assert.Fail("Caught Exception : Failed!");
98 // testingTarget.Dispose();
99 // tlog.Debug(tag, $"TouchGetPointCount END (OK)");
104 //[Description("Touch GetPointCount")]
105 //[Property("SPEC", "Tizen.NUI.Touch.GetPointCount M")]
106 //[Property("SPEC_URL", "-")]
107 //[Property("CRITERIA", "MR")]
108 //[Property("AUTHOR", "guowei.wang@samsung.com")]
109 //public void TouchGetPointCount()
111 // tlog.Debug(tag, $"TouchGetPointCount START");
113 // var testingTarget = new Touch();
114 // Assert.IsNotNull(testingTarget, "Can't create success object Touch");
115 // Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
119 // testingTarget.GetPointCount();
121 // catch (Exception e)
123 // tlog.Debug(tag, e.Message.ToString());
124 // Assert.Fail("Caught Exception : Failed!");
127 // testingTarget.Dispose();
128 // tlog.Debug(tag, $"TouchGetPointCount END (OK)");
133 [Description("Touch GetDeviceId")]
134 [Property("SPEC", "Tizen.NUI.Touch.GetDeviceId M")]
135 [Property("SPEC_URL", "-")]
136 [Property("CRITERIA", "MR")]
137 [Property("AUTHOR", "guowei.wang@samsung.com")]
138 public void TouchGetDeviceId()
140 tlog.Debug(tag, $"TouchGetDeviceId START");
142 var testingTarget = new Touch();
143 Assert.IsNotNull(testingTarget, "Can't create success object Touch");
144 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
148 testingTarget.GetDeviceId(0);
152 tlog.Debug(tag, e.Message.ToString());
153 testingTarget.Dispose();
154 tlog.Debug(tag, $"TouchGetDeviceId END (OK)");
155 Assert.Pass("Caught Exception : Passed!");
161 [Description("Touch GetState")]
162 [Property("SPEC", "Tizen.NUI.Touch.GetState M")]
163 [Property("SPEC_URL", "-")]
164 [Property("CRITERIA", "MR")]
165 [Property("AUTHOR", "guowei.wang@samsung.com")]
166 public void TouchGetState()
168 tlog.Debug(tag, $"TouchGetState START");
170 var testingTarget = new Touch();
171 Assert.IsNotNull(testingTarget, "Can't create success object Touch");
172 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
176 testingTarget.GetState(0);
180 tlog.Debug(tag, e.Message.ToString());
181 testingTarget.Dispose();
182 tlog.Debug(tag, $"TouchGetState END (OK)");
183 Assert.Pass("Caught Exception : Passed!");
189 [Description("Touch GetHitView")]
190 [Property("SPEC", "Tizen.NUI.Touch.GetHitView M")]
191 [Property("SPEC_URL", "-")]
192 [Property("CRITERIA", "MR")]
193 [Property("AUTHOR", "guowei.wang@samsung.com")]
194 public void TouchGetHitView()
196 tlog.Debug(tag, $"TouchGetHitView START");
198 var testingTarget = new Touch();
199 Assert.IsNotNull(testingTarget, "Can't create success object Touch");
200 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
204 testingTarget.GetHitView(0);
208 tlog.Debug(tag, e.Message.ToString());
209 testingTarget.Dispose();
210 tlog.Debug(tag, $"TouchGetHitView END (OK)");
211 Assert.Pass("Caught Exception : Passed!");
217 [Description("Touch GetLocalPosition")]
218 [Property("SPEC", "Tizen.NUI.Touch.GetLocalPosition M")]
219 [Property("SPEC_URL", "-")]
220 [Property("CRITERIA", "MR")]
221 [Property("AUTHOR", "guowei.wang@samsung.com")]
222 public void TouchGetLocalPosition()
224 tlog.Debug(tag, $"TouchGetLocalPosition START");
226 var testingTarget = new Touch();
227 Assert.IsNotNull(testingTarget, "Can't create success object Touch");
228 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
232 testingTarget.GetLocalPosition(0);
236 tlog.Debug(tag, e.Message.ToString());
237 testingTarget.Dispose();
238 tlog.Debug(tag, $"TouchGetLocalPosition END (OK)");
239 Assert.Pass("Caught Exception : Passed!");
245 [Description("Touch GetScreenPosition")]
246 [Property("SPEC", "Tizen.NUI.Touch.GetScreenPosition M")]
247 [Property("SPEC_URL", "-")]
248 [Property("CRITERIA", "MR")]
249 [Property("AUTHOR", "guowei.wang@samsung.com")]
250 public void TouchGetScreenPosition()
252 tlog.Debug(tag, $"TouchGetScreenPosition START");
254 var testingTarget = new Touch();
255 Assert.IsNotNull(testingTarget, "Can't create success object Touch");
256 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
260 testingTarget.GetScreenPosition(0);
264 tlog.Debug(tag, e.Message.ToString());
265 testingTarget.Dispose();
266 tlog.Debug(tag, $"TouchGetScreenPosition END (OK)");
267 Assert.Pass("Caught Exception : Passed!");
273 [Description("Touch GetRadius")]
274 [Property("SPEC", "Tizen.NUI.Touch.GetRadius M")]
275 [Property("SPEC_URL", "-")]
276 [Property("CRITERIA", "MR")]
277 [Property("AUTHOR", "guowei.wang@samsung.com")]
278 public void TouchGetRadius()
280 tlog.Debug(tag, $"TouchGetRadius START");
282 var testingTarget = new Touch();
283 Assert.IsNotNull(testingTarget, "Can't create success object Touch");
284 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
288 testingTarget.GetRadius(0);
292 tlog.Debug(tag, e.Message.ToString());
293 testingTarget.Dispose();
294 tlog.Debug(tag, $"TouchGetRadius END (OK)");
295 Assert.Pass("Caught Exception : Passed!");
301 [Description("Touch GetEllipseRadius")]
302 [Property("SPEC", "Tizen.NUI.Touch.GetEllipseRadius M")]
303 [Property("SPEC_URL", "-")]
304 [Property("CRITERIA", "MR")]
305 [Property("AUTHOR", "guowei.wang@samsung.com")]
306 public void TouchGetEllipseRadius()
308 tlog.Debug(tag, $"TouchGetEllipseRadius START");
310 var testingTarget = new Touch();
311 Assert.IsNotNull(testingTarget, "Can't create success object Touch");
312 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
316 testingTarget.GetEllipseRadius(0);
320 tlog.Debug(tag, e.Message.ToString());
321 testingTarget.Dispose();
322 tlog.Debug(tag, $"TouchGetEllipseRadius END (OK)");
323 Assert.Pass("Caught Exception : Passed!");
329 [Description("Touch GetPressure")]
330 [Property("SPEC", "Tizen.NUI.Touch.GetPressure M")]
331 [Property("SPEC_URL", "-")]
332 [Property("CRITERIA", "MR")]
333 [Property("AUTHOR", "guowei.wang@samsung.com")]
334 public void TouchGetPressure()
336 tlog.Debug(tag, $"TouchGetPressure START");
338 var testingTarget = new Touch();
339 Assert.IsNotNull(testingTarget, "Can't create success object Touch");
340 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
344 testingTarget.GetPressure(0);
348 tlog.Debug(tag, e.Message.ToString());
349 testingTarget.Dispose();
350 tlog.Debug(tag, $"TouchGetPressure END (OK)");
351 Assert.Pass("Caught Exception : Passed!");
357 [Description("Touch GetMouseButton")]
358 [Property("SPEC", "Tizen.NUI.Touch.GetMouseButton M")]
359 [Property("SPEC_URL", "-")]
360 [Property("CRITERIA", "MR")]
361 [Property("AUTHOR", "guowei.wang@samsung.com")]
362 public void TouchGetMouseButton()
364 tlog.Debug(tag, $"TouchGetMouseButton START");
366 var testingTarget = new Touch();
367 Assert.IsNotNull(testingTarget, "Can't create success object Touch");
368 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
372 testingTarget.GetMouseButton(0);
376 tlog.Debug(tag, e.Message.ToString());
377 testingTarget.Dispose();
378 tlog.Debug(tag, $"TouchGetMouseButton END (OK)");
379 Assert.Pass("Caught Exception : Passed!");
385 [Description("Touch GetTouchFromPtr")]
386 [Property("SPEC", "Tizen.NUI.Touch.GetTouchFromPtr M")]
387 [Property("SPEC_URL", "-")]
388 [Property("CRITERIA", "MR")]
389 [Property("AUTHOR", "guowei.wang@samsung.com")]
390 public void TouchGetTouchFromPtr()
392 tlog.Debug(tag, $"TouchGetTouchFromPtr START");
394 using (Touch touch = new Touch())
396 var testingTarget = Touch.GetTouchFromPtr(touch.SwigCPtr.Handle);
397 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
399 testingTarget.Dispose();
402 tlog.Debug(tag, $"TouchGetTouchFromPtr END (OK)");
407 [Description("Touch GetAngle")]
408 [Property("SPEC", "Tizen.NUI.Touch.GetAngle M")]
409 [Property("SPEC_URL", "-")]
410 [Property("CRITERIA", "MR")]
411 [Property("AUTHOR", "guowei.wang@samsung.com")]
412 public void TouchGetAngle()
414 tlog.Debug(tag, $"TouchGetAngle START");
416 var testingTarget = new Touch();
417 Assert.IsNotNull(testingTarget, "Can't create success object Touch");
418 Assert.IsInstanceOf<Touch>(testingTarget, "Should be an instance of Touch type.");
422 testingTarget.GetAngle(0);
426 tlog.Debug(tag, e.Message.ToString());
427 testingTarget.Dispose();
428 tlog.Debug(tag, $"TouchGetAngle END (OK)");
429 Assert.Pass("Caught Exception : Passed!");