3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Threading.Tasks;
8 namespace Tizen.NUI.Devel.Tests
10 using static Tizen.NUI.Animation;
11 using tlog = Tizen.Log;
14 [Description("public/Animation/Animation")]
15 class PublicAnimationTest
17 private const string tag = "NUITEST";
22 tlog.Info(tag, "Init() is called!");
28 tlog.Info(tag, "Destroy() is called!");
33 [Description("Animation constructor")]
34 [Property("SPEC", "Tizen.NUI.Animation.Animation C")]
35 [Property("SPEC_URL", "-")]
36 [Property("CRITERIA", "CONSTR")]
37 [Property("AUTHOR", "guowei.wang@samsung.com")]
38 public void AnimationConstructor()
40 tlog.Debug(tag, $"AnimationConstructor START");
42 var testingTarget = new Animation(2000);
43 Assert.IsNotNull(testingTarget, "should be not null");
44 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
46 testingTarget.Dispose();
47 tlog.Debug(tag, $"AnimationConstructor END (OK)");
52 [Description("Animation Duration. Get")]
53 [Property("SPEC", "Tizen.NUI.Animation.Duration A")]
54 [Property("SPEC_URL", "-")]
55 [Property("CRITERIA", "PRO")]
56 [Property("AUTHOR", "guowei.wang@samsung.com")]
57 public void AnimationDurationGet()
59 tlog.Debug(tag, $"AnimationDurationGet START");
61 var testingTarget = new Animation(2000);
62 Assert.IsNotNull(testingTarget, "should be not null");
63 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
65 var result = testingTarget.Duration;
66 Assert.AreEqual(2000, result, "should be eaqual.");
68 testingTarget.Dispose();
69 tlog.Debug(tag, $"AnimationDurationGet END (OK)");
74 [Description("Animation Duration. Set")]
75 [Property("SPEC", "Tizen.NUI.Animation.Duration A")]
76 [Property("SPEC_URL", "-")]
77 [Property("CRITERIA", "PRO")]
78 [Property("AUTHOR", "guowei.wang@samsung.com")]
79 public void AnimationDurationSet()
81 tlog.Debug(tag, $"AnimationDurationSet START");
83 var testingTarget = new Animation();
84 Assert.IsNotNull(testingTarget, "should be not null");
85 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
87 testingTarget.Duration = 2000;
88 var result = testingTarget.Duration;
89 Assert.AreEqual(2000, result, "should be eaqual.");
91 testingTarget.Dispose();
92 tlog.Debug(tag, $"AnimationDurationSet END (OK)");
97 [Description("Animation DefaultAlphaFunction. Get")]
98 [Property("SPEC", "Tizen.NUI.Animation.DefaultAlphaFunction A")]
99 [Property("SPEC_URL", "-")]
100 [Property("CRITERIA", "PRO")]
101 [Property("AUTHOR", "guowei.wang@samsung.com")]
102 public void AnimationDefaultAlphaFunctionGet()
104 tlog.Debug(tag, $"AnimationDefaultAlphaFunctionGet START");
106 var testingTarget = new Animation();
107 Assert.IsNotNull(testingTarget, "should be not null");
108 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
110 var result = testingTarget.DefaultAlphaFunction;
111 Assert.IsNotNull(result, "should be not null");
112 Assert.IsInstanceOf<AlphaFunction>(result, "should be an instance of AlphaFunction class!");
114 testingTarget.Dispose();
115 tlog.Debug(tag, $"AnimationDefaultAlphaFunctionGet END (OK)");
120 [Description("Animation DefaultAlphaFunction. Set")]
121 [Property("SPEC", "Tizen.NUI.Animation.DefaultAlphaFunction A")]
122 [Property("SPEC_URL", "-")]
123 [Property("CRITERIA", "PRO")]
124 [Property("AUTHOR", "guowei.wang@samsung.com")]
125 public void AnimationDefaultAlphaFunctionSet()
127 tlog.Debug(tag, $"AnimationDefaultAlphaFunctionSet START");
129 var testingTarget = new Animation();
130 Assert.IsNotNull(testingTarget, "should be not null");
131 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
133 testingTarget.DefaultAlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Bounce);
134 var result = testingTarget.DefaultAlphaFunction;
135 Assert.IsNotNull(result, "should be not null");
136 Assert.IsInstanceOf<AlphaFunction>(result, "should be an instance of AlphaFunction class!");
138 testingTarget.Dispose();
139 tlog.Debug(tag, $"AnimationDefaultAlphaFunctionSet END (OK)");
144 [Description("Animation State")]
145 [Property("SPEC", "Tizen.NUI.Animation.State A")]
146 [Property("SPEC_URL", "-")]
147 [Property("CRITERIA", "PRO")]
148 [Property("AUTHOR", "guowei.wang@samsung.com")]
149 public void AnimationState()
151 tlog.Debug(tag, $"AnimationState START");
153 var testingTarget = new Animation();
154 Assert.IsNotNull(testingTarget, "should be not null");
155 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
157 var result = testingTarget.State;
158 Assert.AreEqual("Stopped", result.ToString(), "should be eaqual.");
160 testingTarget.Dispose();
161 tlog.Debug(tag, $"AnimationState END (OK)");
166 [Description("Animation LoopCount. Get")]
167 [Property("SPEC", "Tizen.NUI.Animation.LoopCount A")]
168 [Property("SPEC_URL", "-")]
169 [Property("CRITERIA", "PRO")]
170 [Property("AUTHOR", "guowei.wang@samsung.com")]
171 public void AnimationLoopCountGet()
173 tlog.Debug(tag, $"AnimationLoopCountGet START");
175 var testingTarget = new Animation();
176 Assert.IsNotNull(testingTarget, "should be not null");
177 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
179 var result = testingTarget.LoopCount;
180 Assert.IsTrue(1 == result);
182 testingTarget.Dispose();
183 tlog.Debug(tag, $"AnimationLoopCountGet END (OK)");
188 [Description("Animation LoopCount. Set")]
189 [Property("SPEC", "Tizen.NUI.Animation.LoopCount A")]
190 [Property("SPEC_URL", "-")]
191 [Property("CRITERIA", "PRO")]
192 [Property("AUTHOR", "guowei.wang@samsung.com")]
193 public void AnimationLoopCountSet()
195 tlog.Debug(tag, $"AnimationLoopCountSet START");
197 var testingTarget = new Animation();
198 Assert.IsNotNull(testingTarget, "should be not null");
199 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
201 testingTarget.LoopCount = 3;
202 var result = testingTarget.LoopCount;
203 Assert.IsTrue(3 == result);
205 testingTarget.Dispose();
206 tlog.Debug(tag, $"AnimationLoopCountSet END (OK)");
211 [Description("Animation Looping. Get")]
212 [Property("SPEC", "Tizen.NUI.Animation.Looping A")]
213 [Property("SPEC_URL", "-")]
214 [Property("CRITERIA", "PRO")]
215 [Property("AUTHOR", "guowei.wang@samsung.com")]
216 public void AnimationLoopingGet()
218 tlog.Debug(tag, $"AnimationLoopingGet START");
220 var testingTarget = new Animation();
221 Assert.IsNotNull(testingTarget, "should be not null");
222 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
224 var result = testingTarget.Looping;
225 Assert.IsFalse(result);
227 testingTarget.Dispose();
228 tlog.Debug(tag, $"AnimationLoopingGet END (OK)");
233 [Description("Animation Looping. Set")]
234 [Property("SPEC", "Tizen.NUI.Animation.Looping A")]
235 [Property("SPEC_URL", "-")]
236 [Property("CRITERIA", "PRO")]
237 [Property("AUTHOR", "guowei.wang@samsung.com")]
238 public void AnimationLoopingSet()
240 tlog.Debug(tag, $"AnimationLoopingSet START");
242 var testingTarget = new Animation();
243 Assert.IsNotNull(testingTarget, "should be not null");
244 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
246 testingTarget.Looping = true;
247 var result = testingTarget.Looping;
248 Assert.IsTrue(result);
250 testingTarget.Dispose();
251 tlog.Debug(tag, $"AnimationLoopingSet END (OK)");
256 [Description("Animation EndAction. Get")]
257 [Property("SPEC", "Tizen.NUI.Animation.EndAction A")]
258 [Property("SPEC_URL", "-")]
259 [Property("CRITERIA", "PRO")]
260 [Property("AUTHOR", "guowei.wang@samsung.com")]
261 public void AnimationEndActionGet()
263 tlog.Debug(tag, $"AnimationEndActionGet START");
265 var testingTarget = new Animation();
266 Assert.IsNotNull(testingTarget, "should be not null");
267 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
269 var result = testingTarget.EndAction;
270 Assert.IsTrue(EndActions.Cancel == result);
272 testingTarget.Dispose();
273 tlog.Debug(tag, $"AnimationEndActionGet END (OK)");
278 [Description("Animation EndAction. Set")]
279 [Property("SPEC", "Tizen.NUI.Animation.EndAction A")]
280 [Property("SPEC_URL", "-")]
281 [Property("CRITERIA", "PRO")]
282 [Property("AUTHOR", "guowei.wang@samsung.com")]
283 public void AnimationEndActionSet()
285 tlog.Debug(tag, $"AnimationEndActionSet START");
287 var testingTarget = new Animation();
288 Assert.IsNotNull(testingTarget, "should be not null");
289 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
291 testingTarget.EndAction = Animation.EndActions.Discard;
292 var result = testingTarget.EndAction;
293 Assert.IsTrue(EndActions.Discard == result);
295 testingTarget.Dispose();
296 tlog.Debug(tag, $"AnimationEndActionSet END (OK)");
301 [Description("Animation CurrentLoop")]
302 [Property("SPEC", "Tizen.NUI.Animation.CurrentLoop A")]
303 [Property("SPEC_URL", "-")]
304 [Property("CRITERIA", "PRO")]
305 [Property("AUTHOR", "guowei.wang@samsung.com")]
306 public void AnimationCurrentLoop()
308 tlog.Debug(tag, $"AnimationCurrentLoop START");
310 var testingTarget = new Animation();
311 Assert.IsNotNull(testingTarget, "should be not null");
312 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
314 var result = testingTarget.CurrentLoop;
315 Assert.IsTrue(0 == result);
317 testingTarget.Dispose();
318 tlog.Debug(tag, $"AnimationCurrentLoop END (OK)");
323 [Description("Animation DisconnectAction. Get")]
324 [Property("SPEC", "Tizen.NUI.Animation.DisconnectAction A")]
325 [Property("SPEC_URL", "-")]
326 [Property("CRITERIA", "PRO")]
327 [Property("AUTHOR", "guowei.wang@samsung.com")]
328 public void AnimationDisconnectActionGet()
330 tlog.Debug(tag, $"AnimationDisconnectActionGet START");
332 var testingTarget = new Animation();
333 Assert.IsNotNull(testingTarget, "should be not null");
334 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
336 var result = testingTarget.DisconnectAction;
337 Assert.IsTrue(EndActions.StopFinal == result);
339 testingTarget.Dispose();
340 tlog.Debug(tag, $"AnimationDisconnectActionGet END (OK)");
345 [Description("Animation DisconnectAction. Set")]
346 [Property("SPEC", "Tizen.NUI.Animation.DisconnectAction A")]
347 [Property("SPEC_URL", "-")]
348 [Property("CRITERIA", "PRO")]
349 [Property("AUTHOR", "guowei.wang@samsung.com")]
350 public void AnimationDisconnectActionSet()
352 tlog.Debug(tag, $"AnimationDisconnectActionSet START");
354 var testingTarget = new Animation();
355 Assert.IsNotNull(testingTarget, "should be not null");
356 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
358 testingTarget.DisconnectAction = Animation.EndActions.Cancel;
359 var result = testingTarget.EndAction;
360 Assert.IsTrue(EndActions.Cancel == result);
362 testingTarget.Dispose();
363 tlog.Debug(tag, $"AnimationDisconnectActionSet END (OK)");
368 [Description("Animation CurrentProgress. Get")]
369 [Property("SPEC", "Tizen.NUI.Animation.CurrentProgress A")]
370 [Property("SPEC_URL", "-")]
371 [Property("CRITERIA", "PRO")]
372 [Property("AUTHOR", "guowei.wang@samsung.com")]
373 public void AnimationCurrentProgressGet()
375 tlog.Debug(tag, $"AnimationCurrentProgressGet START");
377 var testingTarget = new Animation();
378 Assert.IsNotNull(testingTarget, "should be not null");
379 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
381 var result = testingTarget.CurrentProgress;
382 Assert.IsTrue(0 == result);
384 testingTarget.Dispose();
385 tlog.Debug(tag, $"AnimationCurrentProgressGet END (OK)");
390 [Description("Animation CurrentProgress. Set")]
391 [Property("SPEC", "Tizen.NUI.Animation.CurrentProgress A")]
392 [Property("SPEC_URL", "-")]
393 [Property("CRITERIA", "PRO")]
394 [Property("AUTHOR", "guowei.wang@samsung.com")]
395 public void AnimationCurrentProgressSet()
397 tlog.Debug(tag, $"AnimationCurrentProgressSet START");
399 var testingTarget = new Animation(3000);
400 Assert.IsNotNull(testingTarget, "should be not null");
401 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
403 testingTarget.CurrentProgress = 0.3f;
404 float result = testingTarget.CurrentProgress;
405 Assert.IsTrue(0 == result);
407 testingTarget.Dispose();
408 tlog.Debug(tag, $"AnimationCurrentProgressSet END (OK)");
413 [Description("Animation SpeedFactor. Get")]
414 [Property("SPEC", "Tizen.NUI.Animation.SpeedFactor A")]
415 [Property("SPEC_URL", "-")]
416 [Property("CRITERIA", "PRO")]
417 [Property("AUTHOR", "guowei.wang@samsung.com")]
418 public void AnimationSpeedFactorGet()
420 tlog.Debug(tag, $"AnimationSpeedFactorGet START");
422 var testingTarget = new Animation();
423 Assert.IsNotNull(testingTarget, "should be not null");
424 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
426 var result = testingTarget.SpeedFactor;
427 Assert.IsTrue(1 == result);
429 testingTarget.Dispose();
430 tlog.Debug(tag, $"AnimationSpeedFactorGet END (OK)");
435 [Description("Animation SpeedFactor. Set")]
436 [Property("SPEC", "Tizen.NUI.Animation.SpeedFactor A")]
437 [Property("SPEC_URL", "-")]
438 [Property("CRITERIA", "PRO")]
439 [Property("AUTHOR", "guowei.wang@samsung.com")]
440 public void AnimationSpeedFactorSet()
442 tlog.Debug(tag, $"AnimationSpeedFactorSet START");
444 var testingTarget = new Animation(3000);
445 Assert.IsNotNull(testingTarget, "should be not null");
446 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
448 testingTarget.SpeedFactor = 2;
449 float result = testingTarget.SpeedFactor;
450 Assert.IsTrue(2 == result);
452 testingTarget.Dispose();
453 tlog.Debug(tag, $"AnimationSpeedFactorSet END (OK)");
458 [Description("Animation PlayRange. Get")]
459 [Property("SPEC", "Tizen.NUI.Animation.PlayRange A")]
460 [Property("SPEC_URL", "-")]
461 [Property("CRITERIA", "PRO")]
462 [Property("AUTHOR", "guowei.wang@samsung.com")]
463 public void AnimationPlayRangeGet()
465 tlog.Debug(tag, $"AnimationPlayRangeGet START");
467 var testingTarget = new Animation();
468 Assert.IsNotNull(testingTarget, "should be not null");
469 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
471 var result = testingTarget.PlayRange;
472 Assert.IsTrue(0 == result.X);
473 Assert.IsTrue(1 == result.Y);
475 testingTarget.Dispose();
476 tlog.Debug(tag, $"AnimationPlayRangeGet END (OK)");
481 [Description("Animation PlayRange. Set")]
482 [Property("SPEC", "Tizen.NUI.Animation.PlayRange A")]
483 [Property("SPEC_URL", "-")]
484 [Property("CRITERIA", "PRO")]
485 [Property("AUTHOR", "guowei.wang@samsung.com")]
486 public void AnimationPlayRangeSet()
488 tlog.Debug(tag, $"AnimationPlayRangeSet START");
490 var testingTarget = new Animation(3000);
491 Assert.IsNotNull(testingTarget, "should be not null");
492 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
494 testingTarget.PlayRange = new RelativeVector2(0.3f, 0.5f);
495 var result = testingTarget.PlayRange;
496 Assert.IsTrue(0.3f == result.X);
497 Assert.IsTrue(0.5f == result.Y);
499 testingTarget.Dispose();
500 tlog.Debug(tag, $"AnimationPlayRangeSet END (OK)");
505 [Description("Animation ProgressNotification. Get")]
506 [Property("SPEC", "Tizen.NUI.Animation.ProgressNotification A")]
507 [Property("SPEC_URL", "-")]
508 [Property("CRITERIA", "PRO")]
509 [Property("AUTHOR", "guowei.wang@samsung.com")]
510 public void AnimationProgressNotificationGet()
512 tlog.Debug(tag, $"AnimationProgressNotificationGet START");
514 var testingTarget = new Animation();
515 Assert.IsNotNull(testingTarget, "should be not null");
516 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
518 var result = testingTarget.ProgressNotification;
519 Assert.IsTrue(0 == result);
521 testingTarget.Dispose();
522 tlog.Debug(tag, $"AnimationProgressNotificationGet END (OK)");
527 [Description("Animation ProgressNotification. Set")]
528 [Property("SPEC", "Tizen.NUI.Animation.ProgressNotification A")]
529 [Property("SPEC_URL", "-")]
530 [Property("CRITERIA", "PRO")]
531 [Property("AUTHOR", "guowei.wang@samsung.com")]
532 public void AnimationProgressNotificationSet()
534 tlog.Debug(tag, $"AnimationProgressNotificationSet START");
536 var testingTarget = new Animation(3000);
537 Assert.IsNotNull(testingTarget, "should be not null");
538 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
540 testingTarget.ProgressNotification = 0.3f;
541 var result = testingTarget.ProgressNotification;
542 Assert.IsTrue(0.3f == result);
544 testingTarget.Dispose();
545 tlog.Debug(tag, $"AnimationProgressNotificationSet END (OK)");
550 [Description("Animation PropertyList. Get")]
551 [Property("SPEC", "Tizen.NUI.Animation.PropertyList A")]
552 [Property("SPEC_URL", "-")]
553 [Property("CRITERIA", "PRO")]
554 [Property("AUTHOR", "guowei.wang@samsung.com")]
555 public void AnimationPropertyList()
557 tlog.Debug(tag, $"AnimationPropertyList START");
559 var testingTarget = new Animation();
560 Assert.IsNotNull(testingTarget, "should be not null");
561 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
563 TransitionAnimation transition = new TransitionAnimation(300);
564 ImageView view = new ImageView();
565 view.ApplyStyle(transition.DefaultImageStyle.Clone());
567 var dummy = new TransitionAnimationData()
570 DestinationValue = "100, 100",
574 transition.AddAnimationData(dummy);
576 for (int i = 0; i < transition.AnimationDataList.Count; i++)
578 testingTarget.PropertyList.Add(transition.AnimationDataList[i].Property);
579 testingTarget.DestValueList.Add(transition.AnimationDataList[i].DestinationValue);
580 testingTarget.StartTimeList.Add(transition.AnimationDataList[i].StartTime);
581 testingTarget.EndTimeList.Add(transition.AnimationDataList[i].EndTime);
584 var result = testingTarget.PropertyList[0];
585 Assert.IsTrue("Size" == result);
588 transition.Dispose();
589 testingTarget.Dispose();
590 tlog.Debug(tag, $"AnimationPropertyList END (OK)");
595 [Description("Animation DestValueList. Get")]
596 [Property("SPEC", "Tizen.NUI.Animation.DestValueList A")]
597 [Property("SPEC_URL", "-")]
598 [Property("CRITERIA", "PRO")]
599 [Property("AUTHOR", "guowei.wang@samsung.com")]
600 public void AnimationDestValueList()
602 tlog.Debug(tag, $"AnimationDestValueList START");
604 var testingTarget = new Animation();
605 Assert.IsNotNull(testingTarget, "should be not null");
606 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
608 TransitionAnimation transition = new TransitionAnimation(300);
609 ImageView view = new ImageView();
610 view.ApplyStyle(transition.DefaultImageStyle.Clone());
612 var dummy = new TransitionAnimationData()
615 DestinationValue = "100, 100",
619 transition.AddAnimationData(dummy);
621 for (int i = 0; i < transition.AnimationDataList.Count; i++)
623 testingTarget.PropertyList.Add(transition.AnimationDataList[i].Property);
624 testingTarget.DestValueList.Add(transition.AnimationDataList[i].DestinationValue);
625 testingTarget.StartTimeList.Add(transition.AnimationDataList[i].StartTime);
626 testingTarget.EndTimeList.Add(transition.AnimationDataList[i].EndTime);
629 var result = testingTarget.DestValueList[0];
630 Assert.IsTrue("100, 100" == result);
633 transition.Dispose();
634 testingTarget.Dispose();
635 tlog.Debug(tag, $"AnimationDestValueList END (OK)");
640 [Description("Animation StartTimeList. Get")]
641 [Property("SPEC", "Tizen.NUI.Animation.StartTimeList A")]
642 [Property("SPEC_URL", "-")]
643 [Property("CRITERIA", "PRO")]
644 [Property("AUTHOR", "guowei.wang@samsung.com")]
645 public void AnimationStartTimeList()
647 tlog.Debug(tag, $"AnimationStartTimeList START");
649 var testingTarget = new Animation();
650 Assert.IsNotNull(testingTarget, "should be not null");
651 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
653 TransitionAnimation transition = new TransitionAnimation(300);
654 ImageView view = new ImageView();
655 view.ApplyStyle(transition.DefaultImageStyle.Clone());
657 var dummy = new TransitionAnimationData()
660 DestinationValue = "100, 100",
664 transition.AddAnimationData(dummy);
666 for (int i = 0; i < transition.AnimationDataList.Count; i++)
668 testingTarget.PropertyList.Add(transition.AnimationDataList[i].Property);
669 testingTarget.DestValueList.Add(transition.AnimationDataList[i].DestinationValue);
670 testingTarget.StartTimeList.Add(transition.AnimationDataList[i].StartTime);
671 testingTarget.EndTimeList.Add(transition.AnimationDataList[i].EndTime);
674 var result = testingTarget.StartTimeList[0];
675 Assert.IsTrue(300 == result);
678 transition.Dispose();
679 testingTarget.Dispose();
680 tlog.Debug(tag, $"AnimationStartTimeList END (OK)");
685 [Description("Animation EndTimeList. Get")]
686 [Property("SPEC", "Tizen.NUI.Animation.EndTimeList A")]
687 [Property("SPEC_URL", "-")]
688 [Property("CRITERIA", "PRO")]
689 [Property("AUTHOR", "guowei.wang@samsung.com")]
690 public void AnimationEndTimeList()
692 tlog.Debug(tag, $"AnimationEndTimeList START");
694 var testingTarget = new Animation();
695 Assert.IsNotNull(testingTarget, "should be not null");
696 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
698 TransitionAnimation transition = new TransitionAnimation(300);
699 ImageView view = new ImageView();
700 view.ApplyStyle(transition.DefaultImageStyle.Clone());
702 var dummy = new TransitionAnimationData()
705 DestinationValue = "100, 100",
709 transition.AddAnimationData(dummy);
711 for (int i = 0; i < transition.AnimationDataList.Count; i++)
713 testingTarget.PropertyList.Add(transition.AnimationDataList[i].Property);
714 testingTarget.DestValueList.Add(transition.AnimationDataList[i].DestinationValue);
715 testingTarget.StartTimeList.Add(transition.AnimationDataList[i].StartTime);
716 testingTarget.EndTimeList.Add(transition.AnimationDataList[i].EndTime);
719 var result = testingTarget.EndTimeList[0];
720 Assert.IsTrue(600 == result);
723 transition.Dispose();
724 testingTarget.Dispose();
725 tlog.Debug(tag, $"AnimationEndTimeList END (OK)");
730 [Description("Animation Stop. Get")]
731 [Property("SPEC", "Tizen.NUI.Animation.Stop M")]
732 [Property("SPEC_URL", "-")]
733 [Property("CRITERIA", "MR")]
734 [Property("AUTHOR", "guowei.wang@samsung.com")]
735 public void AnimationStop()
737 tlog.Debug(tag, $"AnimationStop START");
739 var testingTarget = new Animation();
740 Assert.IsNotNull(testingTarget, "should be not null");
741 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
743 testingTarget.Stop(EndActions.Discard);
744 var result = testingTarget.EndAction;
745 Assert.IsTrue(EndActions.Discard == result);
747 testingTarget.Dispose();
748 tlog.Debug(tag, $"AnimationStop END (OK)");
753 [Description("Animation AnimateBy")]
754 [Property("SPEC", "Tizen.NUI.Animation.AnimateBy M")]
755 [Property("SPEC_URL", "-")]
756 [Property("CRITERIA", "MR")]
757 [Property("AUTHOR", "guowei.wang@samsung.com")]
758 public void AnimationAnimateBy()
760 tlog.Debug(tag, $"AnimationAnimateBy START");
762 View view = new View()
764 Position = new Position(0, 0)
766 Window.Instance.Add(view);
767 Assert.IsTrue(0 == view.Position.X);
768 Assert.IsTrue(0 == view.Position.Y);
770 var testingTarget = new Animation(1500);
771 Assert.IsNotNull(testingTarget, "should be not null");
772 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
774 testingTarget.DefaultAlphaFunction = new AlphaFunction(new Vector2(0.3f, 0), new Vector2(0.15f, 1));
775 testingTarget.AnimateBy(view, "Position", new Position(100, 150));
776 testingTarget.EndAction = Animation.EndActions.StopFinal;
777 testingTarget.Play();
779 Assert.IsTrue(100 == view.Position.X);
780 Assert.IsTrue(150 == view.Position.Y);
783 testingTarget.Dispose();
784 tlog.Debug(tag, $"AnimationAnimateBy END (OK)");
789 [Description("Animation AnimateBy. With start time and end time")]
790 [Property("SPEC", "Tizen.NUI.Animation.AnimateBy M")]
791 [Property("SPEC_URL", "-")]
792 [Property("CRITERIA", "MR")]
793 [Property("AUTHOR", "guowei.wang@samsung.com")]
794 public void AnimationAnimateByWithStartTimeAndEndTime()
796 tlog.Debug(tag, $"AnimationAnimateByWithStartTimeAndEndTime START");
798 var view = new View()
800 Position = new Position(0, 0)
802 Window.Instance.Add(view);
803 Assert.AreEqual(0, view.Position.X, "sholud be eaqual.");
804 Assert.AreEqual(0, view.Position.Y, "sholud be eaqual.");
806 var testingTarget = new Animation(1500);
807 Assert.IsNotNull(testingTarget, "should be not null");
808 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
810 testingTarget.EndAction = Animation.EndActions.StopFinal;
811 testingTarget.DefaultAlphaFunction = new AlphaFunction(new Vector2(0.3f, 0), new Vector2(0.15f, 1));
812 testingTarget.AnimateBy(view, "Position", new Position(100, 150), 0, 0);
813 testingTarget.AnimateBy(view, "Position", new Position(300, 200), 0, 300);
815 testingTarget.Play();
816 Assert.AreEqual(400, view.Position.X, "sholud be eaqual.");
817 Assert.AreEqual(350, view.Position.Y, "sholud be eaqual.");
820 testingTarget.Dispose();
821 tlog.Debug(tag, $"AnimationAnimateByWithStartTimeAndEndTime END (OK)");
826 [Description("Animation AnimateTo")]
827 [Property("SPEC", "Tizen.NUI.Animation.AnimateTo M")]
828 [Property("SPEC_URL", "-")]
829 [Property("CRITERIA", "MR")]
830 [Property("AUTHOR", "guowei.wang@samsung.com")]
831 public void AnimationAnimateTo()
833 tlog.Debug(tag, $"AnimationAnimateTo START");
835 var view = new View()
837 Position = new Position(0, 0)
839 Window.Instance.Add(view);
840 Assert.AreEqual(0, view.Position.X, "sholud be eaqual.");
841 Assert.AreEqual(0, view.Position.Y, "sholud be eaqual.");
843 var testingTarget = new Animation(1500);
844 Assert.IsNotNull(testingTarget, "should be not null");
845 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
847 testingTarget.EndAction = Animation.EndActions.StopFinal;
848 testingTarget.DefaultAlphaFunction = new AlphaFunction(new Vector2(0.3f, 0), new Vector2(0.15f, 1));
849 testingTarget.AnimateTo(view, "Position", new Position(100, 150));
851 testingTarget.Play();
852 Assert.AreEqual(100, view.Position.X, "sholud be eaqual.");
853 Assert.AreEqual(150, view.Position.Y, "sholud be eaqual.");
856 testingTarget.Dispose();
857 tlog.Debug(tag, $"AnimationAnimateTo END (OK)");
862 [Description("Animation AnimateTo. With start time and end time")]
863 [Property("SPEC", "Tizen.NUI.Animation.AnimateTo M")]
864 [Property("SPEC_URL", "-")]
865 [Property("CRITERIA", "MR")]
866 [Property("AUTHOR", "guowei.wang@samsung.com")]
867 public void AnimationAnimateToWithStartTimeAndEndTime()
869 tlog.Debug(tag, $"AnimationAnimateToWithStartTimeAndEndTime START");
871 var view = new View()
873 Position = new Position(0, 0)
875 Window.Instance.Add(view);
876 Assert.AreEqual(0, view.Position.X, "sholud be eaqual.");
877 Assert.AreEqual(0, view.Position.Y, "sholud be eaqual.");
879 var testingTarget = new Animation(1500);
880 Assert.IsNotNull(testingTarget, "should be not null");
881 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
883 testingTarget.EndAction = Animation.EndActions.StopFinal;
884 testingTarget.DefaultAlphaFunction = new AlphaFunction(new Vector2(0.3f, 0), new Vector2(0.15f, 1));
885 testingTarget.AnimateTo(view, "Position", new Position(100, 150), 0, 0);
886 testingTarget.AnimateTo(view, "Position", new Position(300, 200), 0, 300);
888 testingTarget.Play();
889 Assert.AreEqual(300, view.Position.X, "sholud be eaqual.");
890 Assert.AreEqual(200, view.Position.Y, "sholud be eaqual.");
893 testingTarget.Dispose();
894 tlog.Debug(tag, $"AnimationAnimateToWithStartTimeAndEndTime END (OK)");
899 [Description("Animation PlayAnimateTo")]
900 [Property("SPEC", "Tizen.NUI.Animation.PlayAnimateTo M")]
901 [Property("SPEC_URL", "-")]
902 [Property("CRITERIA", "MR")]
903 [Property("AUTHOR", "guowei.wang@samsung.com")]
904 public void AnimationPlayAnimateTo()
906 tlog.Debug(tag, $"AnimationPlayAnimateTo START");
908 var testingTarget = new Animation(1500);
909 Assert.IsNotNull(testingTarget, "should be not null");
910 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
912 TransitionAnimation transition = new TransitionAnimation(300);
913 ImageView view = new ImageView();
914 view.ApplyStyle(transition.DefaultImageStyle.Clone());
916 var dummy1 = new TransitionAnimationData()
919 DestinationValue = "100, 100",
923 transition.AddAnimationData(dummy1);
925 var dummy2 = new TransitionAnimationData()
927 Property = "Position",
928 DestinationValue = "150, 250",
932 transition.AddAnimationData(dummy2);
934 for (int i = 0; i < transition.AnimationDataList.Count; i++)
936 testingTarget.PropertyList.Add(transition.AnimationDataList[i].Property);
937 testingTarget.DestValueList.Add(transition.AnimationDataList[i].DestinationValue);
938 testingTarget.StartTimeList.Add(transition.AnimationDataList[i].StartTime);
939 testingTarget.EndTimeList.Add(transition.AnimationDataList[i].EndTime);
941 testingTarget.PlayAnimateTo(view);
944 transition.Dispose();
945 testingTarget.Dispose();
946 tlog.Debug(tag, $"AnimationPlayAnimateTo END (OK)");
951 [Description("Animation AnimateBetween")]
952 [Property("SPEC", "Tizen.NUI.Animation.AnimateBetween M")]
953 [Property("SPEC_URL", "-")]
954 [Property("CRITERIA", "MR")]
955 [Property("AUTHOR", "guowei.wang@samsung.com")]
956 public void AnimationAnimateBetween()
958 tlog.Debug(tag, $"AnimationAnimateBetween START");
960 View view = new View()
965 var keyFrames = new KeyFrames();
966 Assert.IsNotNull(keyFrames, "should be not null");
967 Assert.IsInstanceOf<KeyFrames>(keyFrames, "should be an instance of Animation class!");
968 keyFrames.Add(0.0f, 1.0f);
970 var testingTarget = new Animation(600);
971 Assert.IsNotNull(testingTarget, "should be not null");
972 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
974 testingTarget.EndAction = Animation.EndActions.StopFinal;
975 testingTarget.AnimateBetween(view, "Opacity", keyFrames);
977 testingTarget.Dispose();
980 tlog.Debug(tag, $"AnimationAnimateBetween END (OK)");
985 [Description("Animation AnimateBetween. With start time and end time")]
986 [Property("SPEC", "Tizen.NUI.Animation.AnimateBetween M")]
987 [Property("SPEC_URL", "-")]
988 [Property("CRITERIA", "MR")]
989 [Property("AUTHOR", "guowei.wang@samsung.com")]
990 public void AnimationAnimateBetweenWithStartTimeAndEndTime()
992 tlog.Debug(tag, $"AnimationAnimateBetweenWithStartTimeAndEndTime START");
994 View view = new View()
999 var keyFrames = new KeyFrames();
1000 Assert.IsNotNull(keyFrames, "should be not null");
1001 Assert.IsInstanceOf<KeyFrames>(keyFrames, "should be an instance of Animation class!");
1002 keyFrames.Add(0.0f, 1.0f);
1004 var testingTarget = new Animation(600);
1005 Assert.IsNotNull(testingTarget, "should be not null");
1006 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
1008 testingTarget.EndAction = Animation.EndActions.StopFinal;
1009 testingTarget.AnimateBetween(view, "Opacity", keyFrames, 0, 600);
1011 testingTarget.Dispose();
1012 keyFrames.Dispose();
1014 tlog.Debug(tag, $"AnimationAnimateBetweenWithStartTimeAndEndTime END (OK)");
1019 [Description("Animation AnimatePath")]
1020 [Property("SPEC", "Tizen.NUI.Animation.AnimatePath M")]
1021 [Property("SPEC_URL", "-")]
1022 [Property("CRITERIA", "MR")]
1023 [Property("AUTHOR", "guowei.wang@samsung.com")]
1024 public void AnimationAnimatePath()
1026 tlog.Debug(tag, $"AnimationAnimatePath START");
1028 View view = new View()
1030 Size = new Size(200, 300)
1033 Path path = new Path();
1034 PropertyArray points = new PropertyArray();
1035 points.PushBack(new PropertyValue(new Vector3(0.5f, 0.0f, 0.8f)));
1036 points.PushBack(new PropertyValue(new Vector3(0.9f, 0.3f, 0.0f)));
1037 path.Points = points;
1039 var testingTarget = new Animation(600);
1040 Assert.IsNotNull(testingTarget, "should be not null");
1041 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
1043 testingTarget.EndAction = Animation.EndActions.StopFinal;
1044 testingTarget.AnimatePath(view, path, new Vector3(0.0f, 0.6f, 1.2f));
1046 testingTarget.Dispose();
1050 tlog.Debug(tag, $"AnimationAnimatePath END (OK)");
1055 [Description("Animation AnimatePath. With start time and end time")]
1056 [Property("SPEC", "Tizen.NUI.Animation.AnimatePath M")]
1057 [Property("SPEC_URL", "-")]
1058 [Property("CRITERIA", "MR")]
1059 [Property("AUTHOR", "guowei.wang@samsung.com")]
1060 public void AnimationAnimatePathWithStartTimeAndEndTime()
1062 tlog.Debug(tag, $"AnimationAnimatePathWithStartTimeAndEndTime START");
1064 View view = new View()
1066 Size = new Size(200, 300)
1069 Path path = new Path();
1070 PropertyArray points = new PropertyArray();
1071 points.PushBack(new PropertyValue(new Vector3(0.5f, 0.0f, 0.8f)));
1072 points.PushBack(new PropertyValue(new Vector3(0.9f, 0.3f, 0.0f)));
1073 path.Points = points;
1075 var testingTarget = new Animation(600);
1076 Assert.IsNotNull(testingTarget, "should be not null");
1077 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
1079 testingTarget.EndAction = Animation.EndActions.StopFinal;
1080 testingTarget.AnimatePath(view, path, new Vector3(0.0f, 0.6f, 1.2f), 0, 600);
1082 testingTarget.Dispose();
1086 tlog.Debug(tag, $"AnimationAnimatePathWithStartTimeAndEndTime END (OK)");
1091 [Description("Animation Play")]
1092 [Property("SPEC", "Tizen.NUI.Animation.Play M")]
1093 [Property("SPEC_URL", "-")]
1094 [Property("CRITERIA", "MR")]
1095 [Property("AUTHOR", "guowei.wang@samsung.com")]
1096 public void AnimationPlay()
1098 tlog.Debug(tag, $"AnimationPlay START");
1100 var testingTarget = new Animation(600);
1101 Assert.IsNotNull(testingTarget, "should be not null");
1102 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
1104 testingTarget.EndAction = Animation.EndActions.StopFinal;
1107 testingTarget.Play();
1108 testingTarget.Stop();
1112 tlog.Error(tag, "Caught Exception" + e.ToString());
1113 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
1114 Assert.Fail("Caught Exception" + e.ToString());
1117 testingTarget.Dispose();
1118 tlog.Debug(tag, $"AnimationPlay END (OK)");
1123 [Description("Animation PlayFrom")]
1124 [Property("SPEC", "Tizen.NUI.Animation.PlayFrom M")]
1125 [Property("SPEC_URL", "-")]
1126 [Property("CRITERIA", "MR")]
1127 [Property("AUTHOR", "guowei.wang@samsung.com")]
1128 public void AnimationPlayFrom()
1130 tlog.Debug(tag, $"AnimationPlayFrom START");
1132 var testingTarget = new Animation(600);
1133 Assert.IsNotNull(testingTarget, "should be not null");
1134 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
1136 testingTarget.EndAction = Animation.EndActions.StopFinal;
1139 testingTarget.PlayFrom(0.3f);
1140 testingTarget.Stop();
1144 tlog.Error(tag, "Caught Exception" + e.ToString());
1145 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
1146 Assert.Fail("Caught Exception" + e.ToString());
1149 testingTarget.Dispose();
1150 tlog.Debug(tag, $"AnimationPlayFrom END (OK)");
1155 [Description("Animation PlayAfter")]
1156 [Property("SPEC", "Tizen.NUI.Animation.PlayAfter M")]
1157 [Property("SPEC_URL", "-")]
1158 [Property("CRITERIA", "MR")]
1159 [Property("AUTHOR", "guowei.wang@samsung.com")]
1160 public void AnimationPlayAfter()
1162 tlog.Debug(tag, $"AnimationPlayAfter START");
1164 var testingTarget = new Animation(600);
1165 Assert.IsNotNull(testingTarget, "should be not null");
1166 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
1168 testingTarget.EndAction = Animation.EndActions.StopFinal;
1171 testingTarget.PlayAfter(300);
1172 testingTarget.Stop();
1176 tlog.Error(tag, "Caught Exception" + e.ToString());
1177 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
1178 Assert.Fail("Caught Exception" + e.ToString());
1181 testingTarget.Dispose();
1182 tlog.Debug(tag, $"AnimationPlayAfter END (OK)");
1187 [Description("Animation Clear")]
1188 [Property("SPEC", "Tizen.NUI.Animation.Stop M")]
1189 [Property("SPEC_URL", "-")]
1190 [Property("CRITERIA", "MR")]
1191 [Property("AUTHOR", "guowei.wang@samsung.com")]
1192 public void AnimationClear()
1194 tlog.Debug(tag, $"AnimationClear START");
1196 var testingTarget = new Animation(600);
1197 Assert.IsNotNull(testingTarget, "should be not null");
1198 Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
1200 testingTarget.EndAction = Animation.EndActions.StopFinal;
1201 testingTarget.Play();
1205 testingTarget.Clear();
1209 tlog.Error(tag, "Caught Exception" + e.ToString());
1210 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
1211 Assert.Fail("Caught Exception" + e.ToString());
1215 testingTarget.Dispose();
1216 tlog.Debug(tag, $"AnimationClear END (OK)");
1221 //[Description("Animation Pause")]
1222 //[Property("SPEC", "Tizen.NUI.Animation.Pause M")]
1223 //[Property("SPEC_URL", "-")]
1224 //[Property("CRITERIA", "MR")]
1225 //[Property("AUTHOR", "guowei.wang@samsung.com")]
1226 //public async Task AnimationPause()
1228 // tlog.Debug(tag, $"AnimationPause START");
1230 // var testingTarget = new Animation(600);
1231 // Assert.IsNotNull(testingTarget, "should be not null");
1232 // Assert.IsInstanceOf<Animation>(testingTarget, "should be an instance of Animation class!");
1234 // testingTarget.EndAction = Animation.EndActions.StopFinal;
1235 // testingTarget.Play();
1236 // await Task.Delay(200);
1237 // testingTarget.Pause();
1238 // var result = testingTarget.GetState();
1239 // Assert.IsTrue(States.Paused == result);
1241 // testingTarget.Play();
1242 // testingTarget.Stop();
1243 // testingTarget.Dispose();
1244 // tlog.Debug(tag, $"AnimationPause END (OK)");