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/PanGestureDetector")]
13 class PublicPanGestureDetectorTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("Create a PanGestureDetector object. Check whether PanGestureDetector is successfully created or not.")]
32 [Property("SPEC", "Tizen.NUI.PanGestureDetector.PanGestureDetector C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("COVPARAM", "")]
36 [Property("AUTHOR", "guowei.wang@samsung.com")]
37 public void PanGestureDetectorConstructor()
39 tlog.Debug(tag, $"PanGestureDetectorConstructor START");
40 PanGestureDetector a1 = new PanGestureDetector();
41 PanGestureDetector a2 = new PanGestureDetector(a1);
46 tlog.Debug(tag, $"PanGestureDetectorConstructor END (OK)");
47 Assert.Pass("PanGestureDetectorConstructor");
52 [Description("Test DirectionLeft property.")]
53 [Property("SPEC", "Tizen.NUI.PanGestureDetector.DirectionLeft A")]
54 [Property("SPEC_URL", "-")]
55 [Property("CRITERIA", "PRW")]
56 [Property("AUTHOR", "guowei.wang@samsung.com")]
57 public void PanGestureDetectorDirectionLeft()
59 tlog.Debug(tag, $"PanGestureDetectorDirectionLeft START");
60 Radian r1 = PanGestureDetector.DirectionLeft;
62 tlog.Debug(tag, $"PanGestureDetectorDirectionLeft END (OK)");
63 Assert.Pass("PanGestureDetectorDirectionLeft");
68 [Description("Test DirectionRight property.")]
69 [Property("SPEC", "Tizen.NUI.PanGestureDetector.DirectionRight A")]
70 [Property("SPEC_URL", "-")]
71 [Property("CRITERIA", "PRW")]
72 [Property("AUTHOR", "guowei.wang@samsung.com")]
73 public void PanGestureDetectorDirectionRight()
75 tlog.Debug(tag, $"PanGestureDetectorDirectionRight START");
76 Radian r1 = PanGestureDetector.DirectionRight;
78 tlog.Debug(tag, $"PanGestureDetectorDirectionRight END (OK)");
79 Assert.Pass("PanGestureDetectorDirectionLeft");
84 [Description("Test DirectionUp property.")]
85 [Property("SPEC", "Tizen.NUI.PanGestureDetector.DirectionUp A")]
86 [Property("SPEC_URL", "-")]
87 [Property("CRITERIA", "PRW")]
88 [Property("AUTHOR", "guowei.wang@samsung.com")]
89 public void PanGestureDetectorDirectionUp()
91 tlog.Debug(tag, $"PanGestureDetectorDirectionUp START");
92 Radian r1 = PanGestureDetector.DirectionUp;
94 tlog.Debug(tag, $"PanGestureDetectorDirectionUp END (OK)");
95 Assert.Pass("PanGestureDetectorDirectionUp");
100 [Description("Test DirectionDown property.")]
101 [Property("SPEC", "Tizen.NUI.PanGestureDetector.DirectionDown A")]
102 [Property("SPEC_URL", "-")]
103 [Property("CRITERIA", "PRW")]
104 [Property("AUTHOR", "guowei.wang@samsung.com")]
105 public void PanGestureDetectorDirectionDown()
107 tlog.Debug(tag, $"PanGestureDetectorDirectionDown START");
108 Radian r1 = PanGestureDetector.DirectionDown;
110 tlog.Debug(tag, $"PanGestureDetectorDirectionDown END (OK)");
111 Assert.Pass("PanGestureDetectorDirectionDown");
116 [Description("Test DirectionHorizontal property.")]
117 [Property("SPEC", "Tizen.NUI.PanGestureDetector.DirectionHorizontal A")]
118 [Property("SPEC_URL", "-")]
119 [Property("CRITERIA", "PRW")]
120 [Property("AUTHOR", "guowei.wang@samsung.com")]
121 public void PanGestureDetectorDirectionHorizontal()
123 tlog.Debug(tag, $"PanGestureDetectorDirectionHorizontal START");
124 Radian r1 = PanGestureDetector.DirectionHorizontal;
126 tlog.Debug(tag, $"PanGestureDetectorDirectionHorizontal END (OK)");
127 Assert.Pass("PanGestureDetectorDirectionHorizontal");
132 [Description("Test DirectionVertical property.")]
133 [Property("SPEC", "Tizen.NUI.PanGestureDetector.DirectionVertical A")]
134 [Property("SPEC_URL", "-")]
135 [Property("CRITERIA", "PRW")]
136 [Property("AUTHOR", "guowei.wang@samsung.com")]
137 public void PanGestureDetectorDirectionVertical()
139 tlog.Debug(tag, $"PanGestureDetectorDirectionVertical START");
140 Radian r1 = PanGestureDetector.DirectionVertical;
142 tlog.Debug(tag, $"PanGestureDetectorDirectionVertical END (OK)");
143 Assert.Pass("PanGestureDetectorDirectionVertical");
148 [Description("Test DefaultThreshold property.")]
149 [Property("SPEC", "Tizen.NUI.PanGestureDetector.DefaultThreshold A")]
150 [Property("SPEC_URL", "-")]
151 [Property("CRITERIA", "PRW")]
152 [Property("AUTHOR", "guowei.wang@samsung.com")]
153 public void PanGestureDetectorDefaultThreshold()
155 tlog.Debug(tag, $"PanGestureDetectorDefaultThreshold START");
156 Radian r1 = PanGestureDetector.DefaultThreshold;
158 tlog.Debug(tag, $"PanGestureDetectorDefaultThreshold END (OK)");
159 Assert.Pass("PanGestureDetectorDefaultThreshold");
164 [Description("Test ScreenPosition property.")]
165 [Property("SPEC", "Tizen.NUI.PanGestureDetector.ScreenPosition A")]
166 [Property("SPEC_URL", "-")]
167 [Property("CRITERIA", "PRW")]
168 [Property("AUTHOR", "guowei.wang@samsung.com")]
169 public void PanGestureDetectorScreenPosition()
171 tlog.Debug(tag, $"PanGestureDetectorScreenPosition START");
172 PanGestureDetector a1 = new PanGestureDetector();
173 Vector2 v1 = a1.ScreenPosition;
175 tlog.Debug(tag, $"PanGestureDetectorScreenPosition END (OK)");
176 Assert.Pass("PanGestureDetectorScreenPosition");
181 [Description("Test ScreenDisplacement property.")]
182 [Property("SPEC", "Tizen.NUI.PanGestureDetector.ScreenDisplacement A")]
183 [Property("SPEC_URL", "-")]
184 [Property("CRITERIA", "PRW")]
185 [Property("AUTHOR", "guowei.wang@samsung.com")]
186 public void PanGestureDetectorScreenDisplacement()
188 tlog.Debug(tag, $"PanGestureDetectorScreenDisplacement START");
189 PanGestureDetector a1 = new PanGestureDetector();
190 Vector2 v1 = a1.ScreenDisplacement;
192 tlog.Debug(tag, $"PanGestureDetectorScreenDisplacement END (OK)");
193 Assert.Pass("PanGestureDetectorScreenDisplacement");
198 [Description("Test ScreenVelocity property.")]
199 [Property("SPEC", "Tizen.NUI.PanGestureDetector.ScreenVelocity A")]
200 [Property("SPEC_URL", "-")]
201 [Property("CRITERIA", "PRW")]
202 [Property("AUTHOR", "guowei.wang@samsung.com")]
203 public void PanGestureDetectorScreenVelocity()
205 tlog.Debug(tag, $"PanGestureDetectorScreenVelocity START");
206 PanGestureDetector a1 = new PanGestureDetector();
207 Vector2 v1 = a1.ScreenVelocity;
209 tlog.Debug(tag, $"PanGestureDetectorScreenVelocity END (OK)");
210 Assert.Pass("PanGestureDetectorScreenVelocity");
215 [Description("Test LocalPosition property.")]
216 [Property("SPEC", "Tizen.NUI.PanGestureDetector.LocalPosition A")]
217 [Property("SPEC_URL", "-")]
218 [Property("CRITERIA", "PRW")]
219 [Property("AUTHOR", "guowei.wang@samsung.com")]
220 public void PanGestureDetectorLocalPosition()
222 tlog.Debug(tag, $"PanGestureDetectorLocalPosition START");
223 PanGestureDetector a1 = new PanGestureDetector();
224 Vector2 v1 = a1.LocalPosition;
226 tlog.Debug(tag, $"PanGestureDetectorLocalPosition END (OK)");
227 Assert.Pass("PanGestureDetectorLocalPosition");
232 [Description("Test LocalDisplacement property.")]
233 [Property("SPEC", "Tizen.NUI.PanGestureDetector.LocalDisplacement A")]
234 [Property("SPEC_URL", "-")]
235 [Property("CRITERIA", "PRW")]
236 [Property("AUTHOR", "guowei.wang@samsung.com")]
237 public void PanGestureDetectorLocalDisplacement()
239 tlog.Debug(tag, $"PanGestureDetectorLocalDisplacement START");
240 PanGestureDetector a1 = new PanGestureDetector();
241 Vector2 v1 = a1.LocalDisplacement;
243 tlog.Debug(tag, $"PanGestureDetectorLocalDisplacement END (OK)");
244 Assert.Pass("PanGestureDetectorLocalDisplacement");
249 [Description("Test LocalVelocity property.")]
250 [Property("SPEC", "Tizen.NUI.PanGestureDetector.LocalVelocity A")]
251 [Property("SPEC_URL", "-")]
252 [Property("CRITERIA", "PRW")]
253 [Property("AUTHOR", "guowei.wang@samsung.com")]
254 public void PanGestureDetectorLocalVelocity()
256 tlog.Debug(tag, $"PanGestureDetectorLocalVelocity START");
257 PanGestureDetector a1 = new PanGestureDetector();
258 Vector2 v1 = a1.LocalVelocity;
260 tlog.Debug(tag, $"PanGestureDetectorLocalVelocity END (OK)");
261 Assert.Pass("PanGestureDetectorLocalVelocity");
266 [Description("Test Panning property.")]
267 [Property("SPEC", "Tizen.NUI.PanGestureDetector.Panning A")]
268 [Property("SPEC_URL", "-")]
269 [Property("CRITERIA", "PRW")]
270 [Property("AUTHOR", "guowei.wang@samsung.com")]
271 public void PanGestureDetectorPanning()
273 tlog.Debug(tag, $"PanGestureDetectorPanning START");
274 PanGestureDetector a1 = new PanGestureDetector();
275 bool b1 = a1.Panning;
277 tlog.Debug(tag, $"PanGestureDetectorPanning END (OK)");
278 Assert.Pass("PanGestureDetectorPanning");
283 [Description("Test SetMinimumTouchesRequired property.")]
284 [Property("SPEC", "Tizen.NUI.PanGestureDetector.SetMinimumTouchesRequired M")]
285 [Property("SPEC_URL", "-")]
286 [Property("CRITERIA", "MR")]
287 [Property("AUTHOR", "guowei.wang@samsung.com")]
288 public void PanGestureDetectorSetMinimumTouchesRequired()
290 tlog.Debug(tag, $"PanGestureDetectorSetMinimumTouchesRequired START");
291 PanGestureDetector a1 = new PanGestureDetector();
293 a1.SetMinimumTouchesRequired(2);
295 tlog.Debug(tag, $"PanGestureDetectorSetMinimumTouchesRequired END (OK)");
296 Assert.Pass("PanGestureDetectorSetMinimumTouchesRequired");
301 [Description("Test SetMaximumTouchesRequired property.")]
302 [Property("SPEC", "Tizen.NUI.PanGestureDetector.SetMaximumTouchesRequired M")]
303 [Property("SPEC_URL", "-")]
304 [Property("CRITERIA", "MR")]
305 [Property("AUTHOR", "guowei.wang@samsung.com")]
306 public void PanGestureDetectorSetMaximumTouchesRequired()
308 tlog.Debug(tag, $"PanGestureDetectorSetMaximumTouchesRequired START");
309 PanGestureDetector a1 = new PanGestureDetector();
310 a1.SetMaximumTouchesRequired(4);
312 tlog.Debug(tag, $"PanGestureDetectorSetMaximumTouchesRequired END (OK)");
313 Assert.Pass("PanGestureDetectorSetMaximumTouchesRequired");
318 [Description("Test GetMinimumTouchesRequired property.")]
319 [Property("SPEC", "Tizen.NUI.PanGestureDetector.GetMinimumTouchesRequired M")]
320 [Property("SPEC_URL", "-")]
321 [Property("CRITERIA", "MR")]
322 [Property("AUTHOR", "guowei.wang@samsung.com")]
323 public void PanGestureDetectorGetMinimumTouchesRequired()
325 tlog.Debug(tag, $"PanGestureDetectorGetMinimumTouchesRequired START");
326 PanGestureDetector a1 = new PanGestureDetector();
327 a1.SetMinimumTouchesRequired(4);
329 a1.GetMinimumTouchesRequired();
331 tlog.Debug(tag, $"PanGestureDetectorGetMinimumTouchesRequired END (OK)");
332 Assert.Pass("PanGestureDetectorSetMaximumTouchesRequired");
337 [Description("Test GetMaximumTouchesRequired property.")]
338 [Property("SPEC", "Tizen.NUI.PanGestureDetector.GetMaximumTouchesRequired M")]
339 [Property("SPEC_URL", "-")]
340 [Property("CRITERIA", "MR")]
341 [Property("AUTHOR", "guowei.wang@samsung.com")]
342 public void PanGestureDetectorGetMaximumTouchesRequired()
344 tlog.Debug(tag, $"PanGestureDetectorGetMaximumTouchesRequired START");
345 PanGestureDetector a1 = new PanGestureDetector();
346 a1.SetMaximumTouchesRequired(4);
348 a1.GetMaximumTouchesRequired();
350 tlog.Debug(tag, $"PanGestureDetectorGetMaximumTouchesRequired END (OK)");
351 Assert.Pass("PanGestureDetectorSetMaximumTouchesRequired");
356 [Description("Test AddAngle property.")]
357 [Property("SPEC", "Tizen.NUI.PanGestureDetector.AddAngle M")]
358 [Property("SPEC_URL", "-")]
359 [Property("CRITERIA", "MR")]
360 [Property("AUTHOR", "guowei.wang@samsung.com")]
361 public void PanGestureDetectorAddAngle()
363 tlog.Debug(tag, $"PanGestureDetectorAddAngle START");
364 PanGestureDetector a1 = new PanGestureDetector();
365 Radian angle = new Radian(4);
366 Radian threshold = new Radian(15);
368 a1.AddAngle(angle, threshold);
369 tlog.Debug(tag, $"PanGestureDetectorAddAngle END (OK)");
370 Assert.Pass("PanGestureDetectorAddAngle");
375 [Description("Test AddDirection property.")]
376 [Property("SPEC", "Tizen.NUI.PanGestureDetector.AddDirection M")]
377 [Property("SPEC_URL", "-")]
378 [Property("CRITERIA", "MR")]
379 [Property("AUTHOR", "guowei.wang@samsung.com")]
380 public void PanGestureDetectorAddDirection()
382 tlog.Debug(tag, $"PanGestureDetectorAddDirection START");
383 PanGestureDetector a1 = new PanGestureDetector();
385 Radian angle = new Radian(4);
386 Radian threshold = new Radian(15);
387 a1.AddDirection(angle);
389 a1.AddDirection(angle, threshold);
392 tlog.Debug(tag, $"PanGestureDetectorAddDirection END (OK)");
393 Assert.Pass("PanGestureDetectorAddDirection");
398 [Description("Test GetAngleCount property.")]
399 [Property("SPEC", "Tizen.NUI.PanGestureDetector.GetAngleCount M")]
400 [Property("SPEC_URL", "-")]
401 [Property("CRITERIA", "MR")]
402 [Property("AUTHOR", "guowei.wang@samsung.com")]
403 public void PanGestureDetectorGetAngleCount()
405 tlog.Debug(tag, $"PanGestureDetectorGetAngleCount START");
406 PanGestureDetector a1 = new PanGestureDetector();
408 Radian angle = new Radian(4);
413 tlog.Debug(tag, $"PanGestureDetectorGetAngleCount END (OK)");
414 Assert.Pass("PanGestureDetectorAddDirection");
419 [Description("Test ClearAngles property.")]
420 [Property("SPEC", "Tizen.NUI.PanGestureDetector.ClearAngles M")]
421 [Property("SPEC_URL", "-")]
422 [Property("CRITERIA", "MR")]
423 [Property("AUTHOR", "guowei.wang@samsung.com")]
424 public void PanGestureDetectorClearAngles()
426 tlog.Debug(tag, $"PanGestureDetectorClearAngles START");
427 PanGestureDetector a1 = new PanGestureDetector();
429 Radian angle = new Radian(4);
434 tlog.Debug(tag, $"PanGestureDetectorClearAngles END (OK)");
435 Assert.Pass("PanGestureDetectorClearAngles");
440 [Description("Test RemoveAngle property.")]
441 [Property("SPEC", "Tizen.NUI.PanGestureDetector.RemoveAngle M")]
442 [Property("SPEC_URL", "-")]
443 [Property("CRITERIA", "MR")]
444 [Property("AUTHOR", "guowei.wang@samsung.com")]
445 public void PanGestureDetectorRemoveAngle()
447 tlog.Debug(tag, $"PanGestureDetectorRemoveAngle START");
448 PanGestureDetector a1 = new PanGestureDetector();
450 Radian angle = new Radian(4);
453 a1.RemoveAngle(angle);
455 tlog.Debug(tag, $"PanGestureDetectorRemoveAngle END (OK)");
456 Assert.Pass("PanGestureDetectorClearAngles");
462 [Description("Test RemoveDirection property.")]
463 [Property("SPEC", "Tizen.NUI.PanGestureDetector.RemoveDirection M")]
464 [Property("SPEC_URL", "-")]
465 [Property("CRITERIA", "MR")]
466 [Property("AUTHOR", "guowei.wang@samsung.com")]
467 public void PanGestureDetectorRemoveDirection()
469 tlog.Debug(tag, $"PanGestureDetectorRemoveDirection START");
470 PanGestureDetector a1 = new PanGestureDetector();
472 Radian angle = new Radian(4);
473 a1.AddDirection(angle);
475 a1.RemoveDirection(angle);
477 tlog.Debug(tag, $"PanGestureDetectorRemoveDirection END (OK)");
478 Assert.Pass("PanGestureDetectorClearAngles");
483 [Description("Test SetPanGestureProperties property.")]
484 [Property("SPEC", "Tizen.NUI.PanGestureDetector.SetPanGestureProperties M")]
485 [Property("SPEC_URL", "-")]
486 [Property("CRITERIA", "MR")]
487 [Property("AUTHOR", "guowei.wang@samsung.com")]
488 public void PanGestureDetectorSetPanGestureProperties()
490 tlog.Debug(tag, $"PanGestureDetectorSetPanGestureProperties START");
491 PanGesture pan = new PanGesture();
493 PanGestureDetector.SetPanGestureProperties(pan);
495 tlog.Debug(tag, $"PanGestureDetectorSetPanGestureProperties END (OK)");
496 Assert.Pass("PanGestureDetectorClearAngles");
501 [Description("Test GetPanGestureDetectorFromPtr property.")]
502 [Property("SPEC", "Tizen.NUI.PanGestureDetector.GetPanGestureDetectorFromPtr M")]
503 [Property("SPEC_URL", "-")]
504 [Property("CRITERIA", "MR")]
505 [Property("AUTHOR", "guowei.wang@samsung.com")]
506 public void PanGestureDetectorGetPanGestureDetectorFromPtr()
508 tlog.Debug(tag, $"PanGestureDetectorGetPanGestureDetectorFromPtr START");
509 PanGestureDetector a1 = new PanGestureDetector();
511 PanGestureDetector.GetPanGestureDetectorFromPtr(PanGestureDetector.getCPtr(a1).Handle);
514 tlog.Debug(tag, $"PanGestureDetectorGetPanGestureDetectorFromPtr END (OK)");
515 Assert.Pass("PanGestureDetectorGetPanGestureDetectorFromPtr");
520 [Description("Test Detected property.")]
521 [Property("SPEC", "Tizen.NUI.PanGestureDetector.Detected A")]
522 [Property("SPEC_URL", "-")]
523 [Property("CRITERIA", "PRW")]
524 [Property("AUTHOR", "guowei.wang@samsung.com")]
525 public void PanGestureDetectorDetected()
527 tlog.Debug(tag, $"PanGestureDetectorDetected START");
528 PanGestureDetector a1 = new PanGestureDetector();
530 a1.Detected += OnDetected;
531 a1.Detected -= OnDetected;
533 PanGestureDetector.DetectedEventArgs e = new PanGestureDetector.DetectedEventArgs();
534 object o = new object();
540 tlog.Debug(tag, $"PanGestureDetectorDetected END (OK)");
541 Assert.Pass("PanGestureDetectorDetected");
544 private void OnDetected(object obj, PanGestureDetector.DetectedEventArgs e)
549 PanGesture p1 = e.PanGesture;