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("Internal/Transition/TransitionSet")]
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("TransitionSet constructor.")]
32 [Property("SPEC", "Tizen.NUI.TransitionSet.TransitionSet C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void TransitionSetConstructor()
38 tlog.Debug(tag, $"TransitionSetConstructor START");
40 var testingTarget = new TransitionSet();
41 Assert.IsNotNull(testingTarget, "Should be not null!");
42 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
44 testingTarget.Dispose();
45 tlog.Debug(tag, $"TransitionSetConstructor END (OK)");
50 [Description("TransitionSet DownCast.")]
51 [Property("SPEC", "Tizen.NUI.TransitionSet.DownCast M")]
52 [Property("SPEC_URL", "-")]
53 [Property("CRITERIA", "MR")]
54 [Property("AUTHOR", "guowei.wang@samsung.com")]
55 public void TransitionSetDownCast()
57 tlog.Debug(tag, $"TransitionSetDownCast START");
59 using (TransitionSet transitionSet = new TransitionSet())
61 var testingTarget = TransitionSet.DownCast(transitionSet);
62 Assert.IsNotNull(testingTarget, "Should be not null!");
63 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
65 testingTarget.Dispose();
68 tlog.Debug(tag, $"TransitionSetDownCast END (OK)");
73 [Description("TransitionSet AddTransition.")]
74 [Property("SPEC", "Tizen.NUI.TransitionSet.AddTransition M")]
75 [Property("SPEC_URL", "-")]
76 [Property("CRITERIA", "MR")]
77 [Property("AUTHOR", "guowei.wang@samsung.com")]
78 public void TransitionSetAddTransition()
80 tlog.Debug(tag, $"TransitionSetAddTransition START");
82 View view = new View()
85 TransitionOptions = new TransitionOptions(Window.Instance)
87 view.TransitionOptions.TransitionTag = "Transition";
88 view.TransitionOptions.EnableTransition = true;
90 TransitionItemBase transitionItemBase = null;
91 using (TimePeriod timePeriod = new TimePeriod(500))
93 using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default))
95 transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction);
99 var testingTarget = new TransitionSet();
100 Assert.IsNotNull(testingTarget, "Should be not null!");
101 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
105 testingTarget.AddTransition(transitionItemBase);
109 tlog.Error(tag, "Caught Exception" + e.ToString());
110 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
111 Assert.Fail("Caught Exception" + e.ToString());
115 transitionItemBase.Dispose();
116 testingTarget.Dispose();
117 tlog.Debug(tag, $"TransitionSetAddTransition END (OK)");
122 [Description("TransitionSet GetTransitionAt.")]
123 [Property("SPEC", "Tizen.NUI.TransitionSet.GetTransitionAt M")]
124 [Property("SPEC_URL", "-")]
125 [Property("CRITERIA", "MR")]
126 [Property("AUTHOR", "guowei.wang@samsung.com")]
127 public void TransitionSetGetTransitionAt()
129 tlog.Debug(tag, $"TransitionSetGetTransitionAt START");
131 View view = new View()
134 TransitionOptions = new TransitionOptions(Window.Instance)
136 view.TransitionOptions.TransitionTag = "Transition";
137 view.TransitionOptions.EnableTransition = true;
139 TransitionItemBase transitionItemBase = null;
140 using (TimePeriod timePeriod = new TimePeriod(500))
142 using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default))
144 transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction);
148 var testingTarget = new TransitionSet();
149 Assert.IsNotNull(testingTarget, "Should be not null!");
150 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
152 testingTarget.AddTransition(transitionItemBase);
154 var result = testingTarget.GetTransitionAt(1);
155 Assert.IsNotNull(result, "Should be not null!");
156 Assert.IsInstanceOf<TransitionItemBase>(result, "Should be an Instance of TransitionItemBase!");
159 transitionItemBase.Dispose();
160 testingTarget.Dispose();
161 tlog.Debug(tag, $"TransitionSetGetTransitionAt END (OK)");
166 [Description("TransitionSet GetTransitionCount.")]
167 [Property("SPEC", "Tizen.NUI.TransitionSet.GetTransitionCount M")]
168 [Property("SPEC_URL", "-")]
169 [Property("CRITERIA", "MR")]
170 [Property("AUTHOR", "guowei.wang@samsung.com")]
171 public void TransitionSetGetTransitionCount()
173 tlog.Debug(tag, $"TransitionSetGetTransitionCount START");
175 View view = new View()
178 TransitionOptions = new TransitionOptions(Window.Instance)
180 view.TransitionOptions.TransitionTag = "Transition";
181 view.TransitionOptions.EnableTransition = true;
183 TransitionItemBase transitionItemBase = null;
184 using (TimePeriod timePeriod = new TimePeriod(500))
186 using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default))
188 transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction);
192 var testingTarget = new TransitionSet();
193 Assert.IsNotNull(testingTarget, "Should be not null!");
194 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
196 testingTarget.AddTransition(transitionItemBase);
198 var result = testingTarget.GetTransitionCount();
199 Assert.IsTrue(1 == result);
202 transitionItemBase.Dispose();
203 testingTarget.Dispose();
204 tlog.Debug(tag, $"TransitionSetGetTransitionCount END (OK)");
209 [Description("TransitionSet Play.")]
210 [Property("SPEC", "Tizen.NUI.TransitionSet.Play M")]
211 [Property("SPEC_URL", "-")]
212 [Property("CRITERIA", "MR")]
213 [Property("AUTHOR", "guowei.wang@samsung.com")]
214 public void TransitionSetPlay()
216 tlog.Debug(tag, $"TransitionSetPlay START");
218 View view = new View()
221 TransitionOptions = new TransitionOptions(Window.Instance)
223 view.TransitionOptions.TransitionTag = "Transition";
224 view.TransitionOptions.EnableTransition = true;
226 TransitionItemBase transitionItemBase = null;
227 using (TimePeriod timePeriod = new TimePeriod(500))
229 using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default))
231 transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction);
235 var testingTarget = new TransitionSet();
236 Assert.IsNotNull(testingTarget, "Should be not null!");
237 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
239 testingTarget.AddTransition(transitionItemBase);
243 testingTarget.Play();
247 tlog.Error(tag, "Caught Exception" + e.ToString());
248 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
249 Assert.Fail("Caught Exception" + e.ToString());
253 transitionItemBase.Dispose();
254 testingTarget.Dispose();
255 tlog.Debug(tag, $"TransitionSetPlay END (OK)");
260 [Description("TransitionSet Assign.")]
261 [Property("SPEC", "Tizen.NUI.TransitionSet.Assign M")]
262 [Property("SPEC_URL", "-")]
263 [Property("CRITERIA", "MR")]
264 [Property("AUTHOR", "guowei.wang@samsung.com")]
265 public void TransitionSetAssign()
267 tlog.Debug(tag, $"TransitionSetAssign START");
269 View view = new View()
272 TransitionOptions = new TransitionOptions(Window.Instance)
274 view.TransitionOptions.TransitionTag = "Transition";
275 view.TransitionOptions.EnableTransition = true;
277 TransitionItemBase transitionItemBase = null;
278 using (TimePeriod timePeriod = new TimePeriod(500))
280 using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default))
282 transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction);
286 var transitionSet = new TransitionSet();
287 Assert.IsNotNull(transitionSet, "Should be not null!");
288 Assert.IsInstanceOf<TransitionSet>(transitionSet, "Should be an Instance of TransitionSet!");
290 transitionSet.AddTransition(transitionItemBase);
292 var testingTarget = new TransitionSet();
293 var result = transitionSet.Assign(testingTarget);
294 Assert.IsNotNull(result, "Should be not null!");
295 Assert.IsInstanceOf<TransitionSet>(result, "Should be an Instance of TransitionSet!");
298 transitionItemBase.Dispose();
299 testingTarget.Dispose();
300 tlog.Debug(tag, $"TransitionSetAssign END (OK)");
305 [Description("TransitionSet FinishedSignal.")]
306 [Property("SPEC", "Tizen.NUI.TransitionSet.FinishedSignal M")]
307 [Property("SPEC_URL", "-")]
308 [Property("CRITERIA", "MR")]
309 [Property("AUTHOR", "guowei.wang@samsung.com")]
310 public void TransitionSetFinishedSignal()
312 tlog.Debug(tag, $"TransitionSetFinishedSignal START");
314 View view = new View()
317 TransitionOptions = new TransitionOptions(Window.Instance)
319 view.TransitionOptions.TransitionTag = "Transition";
320 view.TransitionOptions.EnableTransition = true;
322 TransitionItemBase transitionItemBase = null;
323 using (TimePeriod timePeriod = new TimePeriod(500))
325 using (AlphaFunction alphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.Default))
327 transitionItemBase = new TransitionItemBase(view, true, timePeriod, alphaFunction);
331 var transitionSet = new TransitionSet();
332 Assert.IsNotNull(transitionSet, "Should be not null!");
333 Assert.IsInstanceOf<TransitionSet>(transitionSet, "Should be an Instance of TransitionSet!");
335 transitionSet.AddTransition(transitionItemBase);
337 var testingTarget = transitionSet.FinishedSignal();
338 Assert.IsNotNull(testingTarget, "Should be not null!");
339 Assert.IsInstanceOf<TransitionSetFinishedSignal>(testingTarget, "Should be an Instance of TransitionSet!");
342 transitionItemBase.Dispose();
343 tlog.Debug(tag, $"TransitionSetFinishedSignal END (OK)");
349 [Description("TransitionSet Dispose.")]
350 [Property("SPEC", "Tizen.NUI.TransitionSet.Dispose M")]
351 [Property("SPEC_URL", "-")]
352 [Property("CRITERIA", "MR")]
353 [Property("AUTHOR", "guowei.wang@samsung.com")]
354 public void TransitionSetDispose()
356 tlog.Debug(tag, $"TransitionSetDispose START");
358 var testingTarget = new TransitionSet();
359 Assert.IsNotNull(testingTarget, "Should be not null!");
360 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
364 testingTarget.Dispose();
368 tlog.Error(tag, "Caught Exception" + e.ToString());
369 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
370 Assert.Fail("Caught Exception" + e.ToString());
373 tlog.Debug(tag, $"TransitionSetDispose END (OK)");