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")]
13 public class InternalTransitionSetTest
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 Finished.")]
123 [Property("SPEC", "Tizen.NUI.TransitionSet.Finished A")]
124 [Property("SPEC_URL", "-")]
125 [Property("CRITERIA", "PRW")]
126 [Property("AUTHOR", "guowei.wang@samsung.com")]
127 public void TransitionSetFinished()
129 tlog.Debug(tag, $"TransitionSetFinished 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 testingTarget.Finished += MyOnFinished;
155 testingTarget.Finished -= MyOnFinished;
157 testingTarget.Dispose();
158 tlog.Debug(tag, $"TransitionSetFinished END (OK)");
161 private void MyOnFinished(object sender, EventArgs e) { }
165 [Description("TransitionSet GetTransitionAt.")]
166 [Property("SPEC", "Tizen.NUI.TransitionSet.GetTransitionAt M")]
167 [Property("SPEC_URL", "-")]
168 [Property("CRITERIA", "MR")]
169 [Property("AUTHOR", "guowei.wang@samsung.com")]
170 public void TransitionSetGetTransitionAt()
172 tlog.Debug(tag, $"TransitionSetGetTransitionAt START");
174 using (View view = new View())
176 var testingTarget = new TransitionSet(view.SwigCPtr.Handle, false);
177 Assert.IsNotNull(testingTarget, "Should be not null!");
178 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
182 testingTarget.GetTransitionAt(0);
186 tlog.Error(tag, "Caught Exception" + e.ToString());
187 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
188 Assert.Fail("Caught Exception" + e.ToString());
192 tlog.Debug(tag, $"TransitionSetGetTransitionAt END (OK)");
197 [Description("TransitionSet GetTransitionCount.")]
198 [Property("SPEC", "Tizen.NUI.TransitionSet.GetTransitionCount M")]
199 [Property("SPEC_URL", "-")]
200 [Property("CRITERIA", "MR")]
201 [Property("AUTHOR", "guowei.wang@samsung.com")]
202 public void TransitionSetGetTransitionCount()
204 tlog.Debug(tag, $"TransitionSetGetTransitionCount START");
206 using (View view = new View())
208 var testingTarget = new TransitionSet(view.SwigCPtr.Handle, false);
209 Assert.IsNotNull(testingTarget, "Should be not null!");
210 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
214 testingTarget.GetTransitionCount();
218 tlog.Error(tag, "Caught Exception" + e.ToString());
219 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
220 Assert.Fail("Caught Exception" + e.ToString());
224 tlog.Debug(tag, $"TransitionSetGetTransitionCount END (OK)");
229 [Description("TransitionSet Play.")]
230 [Property("SPEC", "Tizen.NUI.TransitionSet.Play M")]
231 [Property("SPEC_URL", "-")]
232 [Property("CRITERIA", "MR")]
233 [Property("AUTHOR", "guowei.wang@samsung.com")]
234 public void TransitionSetPlay()
236 tlog.Debug(tag, $"TransitionSetPlay START");
238 using (View view = new View())
240 var testingTarget = new TransitionSet(view.SwigCPtr.Handle, false);
241 Assert.IsNotNull(testingTarget, "Should be not null!");
242 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
246 testingTarget.Play();
250 tlog.Error(tag, "Caught Exception" + e.ToString());
251 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
252 Assert.Fail("Caught Exception" + e.ToString());
256 tlog.Debug(tag, $"TransitionSetPlay END (OK)");
261 [Description("TransitionSet Assign.")]
262 [Property("SPEC", "Tizen.NUI.TransitionSet.Assign M")]
263 [Property("SPEC_URL", "-")]
264 [Property("CRITERIA", "MR")]
265 [Property("AUTHOR", "guowei.wang@samsung.com")]
266 public void TransitionSetAssign()
268 tlog.Debug(tag, $"TransitionSetAssign START");
270 using (View view = new View())
272 var testingTarget = new TransitionSet(view.SwigCPtr.Handle, false);
273 Assert.IsNotNull(testingTarget, "Should be not null!");
274 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
278 testingTarget.Assign(testingTarget);
282 tlog.Error(tag, "Caught Exception" + e.ToString());
283 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
284 Assert.Fail("Caught Exception" + e.ToString());
288 tlog.Debug(tag, $"TransitionSetAssign END (OK)");
293 [Description("TransitionSet FinishedSignal.")]
294 [Property("SPEC", "Tizen.NUI.TransitionSet.FinishedSignal M")]
295 [Property("SPEC_URL", "-")]
296 [Property("CRITERIA", "MR")]
297 [Property("AUTHOR", "guowei.wang@samsung.com")]
298 public void TransitionSetFinishedSignal()
300 tlog.Debug(tag, $"TransitionSetFinishedSignal START");
302 using (View view = new View())
304 var testingTarget = new TransitionSet(view.SwigCPtr.Handle, false);
305 Assert.IsNotNull(testingTarget, "Should be not null!");
306 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
310 testingTarget.FinishedSignal();
314 tlog.Error(tag, "Caught Exception" + e.ToString());
315 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
316 Assert.Fail("Caught Exception" + e.ToString());
320 tlog.Debug(tag, $"TransitionSetFinishedSignal END (OK)");