3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("public/Visuals/VisualAnimator")]
13 public class PublicVisualAnimatorTest
15 private const string tag = "NUITEST";
16 private string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
17 private static bool flagComposingPropertyMap;
18 internal class MyVisualAnimator : VisualAnimator
20 protected override void ComposingPropertyMap()
22 flagComposingPropertyMap = true;
23 base.ComposingPropertyMap();
30 tlog.Info(tag, "Init() is called!");
36 tlog.Info(tag, "Destroy() is called!");
41 [Description("VisualAnimator constructor.")]
42 [Property("SPEC", "Tizen.NUI.VisualAnimator.VisualAnimator C")]
43 [Property("SPEC_URL", "-")]
44 [Property("CRITERIA", "CONSTR")]
45 [Property("AUTHOR", "guowei.wang@samsung.com")]
46 public void VisualAnimatorConstructor()
48 tlog.Debug(tag, $"VisualAnimatorConstructor START");
50 var testingTarget = new VisualAnimator();
51 Assert.IsNotNull(testingTarget, "Can't create success object VisualAnimator");
52 Assert.IsInstanceOf<VisualAnimator>(testingTarget, "Should be an instance of VisualAnimator type.");
54 testingTarget.Dispose();
55 tlog.Debug(tag, $"VisualAnimatorConstructor END (OK)");
60 [Description("VisualAnimator AlphaFunction.")]
61 [Property("SPEC", "Tizen.NUI.VisualAnimator.AlphaFunction A")]
62 [Property("SPEC_URL", "-")]
63 [Property("CRITERIA", "PRW")]
64 [Property("AUTHOR", "guowei.wang@samsung.com")]
65 public void VisualAnimatorAlphaFunction()
67 tlog.Debug(tag, $"VisualAnimatorAlphaFunction START");
69 var testingTarget = new VisualAnimator();
70 Assert.IsNotNull(testingTarget, "Can't create success object VisualAnimator");
71 Assert.IsInstanceOf<VisualAnimator>(testingTarget, "Should be an instance of VisualAnimator type.");
73 testingTarget.AlphaFunction = AlphaFunction.BuiltinFunctions.EaseIn;
74 Assert.AreEqual(AlphaFunction.BuiltinFunctions.EaseIn, testingTarget.AlphaFunction, "Retrieved AlphaFunction should be equal to set value");
76 testingTarget.Dispose();
77 tlog.Debug(tag, $"VisualAnimatorAlphaFunction END (OK)");
82 [Description("VisualAnimator StartTime.")]
83 [Property("SPEC", "Tizen.NUI.VisualAnimator.StartTime A")]
84 [Property("SPEC_URL", "-")]
85 [Property("CRITERIA", "PRW")]
86 [Property("AUTHOR", "guowei.wang@samsung.com")]
87 public void VisualAnimatorStartTime()
89 tlog.Debug(tag, $"VisualAnimatorStartTime START");
91 var testingTarget = new VisualAnimator();
92 Assert.IsNotNull(testingTarget, "Can't create success object VisualAnimator");
93 Assert.IsInstanceOf<VisualAnimator>(testingTarget, "Should be an instance of VisualAnimator type.");
95 testingTarget.StartTime = 10;
96 Assert.AreEqual(10, testingTarget.StartTime, "Retrieved StartTime should be equal to set value");
98 testingTarget.Dispose();
99 tlog.Debug(tag, $"VisualAnimatorStartTime END (OK)");
104 [Description("VisualAnimator EndTime.")]
105 [Property("SPEC", "Tizen.NUI.VisualAnimator.EndTime A")]
106 [Property("SPEC_URL", "-")]
107 [Property("CRITERIA", "PRW")]
108 [Property("AUTHOR", "guowei.wang@samsung.com")]
109 public void VisualAnimatorEndTime()
111 tlog.Debug(tag, $"VisualAnimatorEndTime START");
113 var testingTarget = new VisualAnimator();
114 Assert.IsNotNull(testingTarget, "Can't create success object VisualAnimator");
115 Assert.IsInstanceOf<VisualAnimator>(testingTarget, "Should be an instance of VisualAnimator type.");
117 testingTarget.EndTime = 1000;
118 Assert.AreEqual(1000, testingTarget.EndTime, "Retrieved EndTime should be equal to set value");
120 testingTarget.Dispose();
121 tlog.Debug(tag, $"VisualAnimatorEndTime END (OK)");
126 [Description("VisualAnimator Target.")]
127 [Property("SPEC", "Tizen.NUI.VisualAnimator.Target A")]
128 [Property("SPEC_URL", "-")]
129 [Property("CRITERIA", "PRW")]
130 [Property("AUTHOR", "guowei.wang@samsung.com")]
131 public void VisualAnimatorTarget()
133 tlog.Debug(tag, $"VisualAnimatorTarget START");
135 var testingTarget = new VisualAnimator();
136 Assert.IsNotNull(testingTarget, "Can't create success object VisualAnimator");
137 Assert.IsInstanceOf<VisualAnimator>(testingTarget, "Should be an instance of VisualAnimator type.");
139 testingTarget.Target = "IconVisual";
140 Assert.AreEqual("IconVisual", testingTarget.Target, "Retrieved Target should be equal to set value");
142 testingTarget.Dispose();
143 tlog.Debug(tag, $"VisualAnimatorTarget END (OK)");
148 [Description("VisualAnimator PropertyIndex.")]
149 [Property("SPEC", "Tizen.NUI.VisualAnimator.PropertyIndex A")]
150 [Property("SPEC_URL", "-")]
151 [Property("CRITERIA", "PRW")]
152 [Property("AUTHOR", "guowei.wang@samsung.com")]
153 public void VisualAnimatorPropertyIndex()
155 tlog.Debug(tag, $"VisualAnimatorPropertyIndex START");
157 var testingTarget = new VisualAnimator();
158 Assert.IsNotNull(testingTarget, "Can't create success object VisualAnimator");
159 Assert.IsInstanceOf<VisualAnimator>(testingTarget, "Should be an instance of VisualAnimator type.");
161 testingTarget.PropertyIndex = "MixColor";
162 Assert.AreEqual("MixColor", testingTarget.PropertyIndex, "Retrieved PropertyIndex should be equal to set value");
164 testingTarget.Dispose();
165 tlog.Debug(tag, $"VisualAnimatorPropertyIndex END (OK)");
170 [Description("VisualAnimator DestinationValue.")]
171 [Property("SPEC", "Tizen.NUI.VisualAnimator.DestinationValue A")]
172 [Property("SPEC_URL", "-")]
173 [Property("CRITERIA", "PRW")]
174 [Property("AUTHOR", "guowei.wang@samsung.com")]
175 public void VisualAnimatorDestinationValue()
177 tlog.Debug(tag, $"VisualAnimatorDestinationValue START");
179 var testingTarget = new VisualAnimator();
180 Assert.IsNotNull(testingTarget, "Can't create success object VisualAnimator");
181 Assert.IsInstanceOf<VisualAnimator>(testingTarget, "Should be an instance of VisualAnimator type.");
183 using (Color color = new Color(1.0f, 0.0f, 1.0f, 1.0f))
185 testingTarget.DestinationValue = color;
186 Assert.IsTrue(color.Equals(testingTarget.DestinationValue), "Retrieved DestinationValue should be equal to set value");
189 testingTarget.Dispose();
190 tlog.Debug(tag, $"VisualAnimatorDestinationValue END (OK)");
195 [Description("VisualAnimator ComposingPropertyMap.")]
196 [Property("SPEC", "Tizen.NUI.VisualAnimator.ComposingPropertyMap M")]
197 [Property("SPEC_URL", "-")]
198 [Property("CRITERIA", "MR")]
199 [Property("AUTHOR", "guowei.wang@samsung.com")]
200 public void VisualAnimatorComposingPropertyMap()
202 tlog.Debug(tag, $"VisualAnimatorComposingPropertyMap START");
204 flagComposingPropertyMap = false;
205 Assert.False(flagComposingPropertyMap, "flagComposingPropertyMap should false initial");
207 var testingTarget = new MyVisualAnimator()
209 AlphaFunction = AlphaFunction.BuiltinFunctions.EaseIn,
212 Target = "IconVisual",
213 PropertyIndex = "MixColor"
215 Assert.IsInstanceOf<VisualAnimator>(testingTarget, "Should be an instance of VisualAnimator type.");
216 PropertyMap propertyMap = testingTarget.OutputVisualMap;
217 Assert.True(flagComposingPropertyMap, "ComposingPropertyMap overrided method not invoked.");
219 testingTarget.Dispose();
220 tlog.Debug(tag, $"VisualAnimatorComposingPropertyMap END (OK)");