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 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 // using (View view = new View())
133 // var testingTarget = new TransitionSet(view.SwigCPtr.Handle, false);
134 // Assert.IsNotNull(testingTarget, "Should be not null!");
135 // Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
137 // testingTarget.Finished += MyOnFinished;
138 // testingTarget.Finished -= MyOnFinished;
140 // testingTarget.Dispose();
143 // tlog.Debug(tag, $"TransitionSetFinished END (OK)");
146 //private void MyOnFinished(object sender, EventArgs e) { }
150 [Description("TransitionSet GetTransitionAt.")]
151 [Property("SPEC", "Tizen.NUI.TransitionSet.GetTransitionAt M")]
152 [Property("SPEC_URL", "-")]
153 [Property("CRITERIA", "MR")]
154 [Property("AUTHOR", "guowei.wang@samsung.com")]
155 public void TransitionSetGetTransitionAt()
157 tlog.Debug(tag, $"TransitionSetGetTransitionAt START");
159 using (View view = new View())
161 var testingTarget = new TransitionSet(view.SwigCPtr.Handle, false);
162 Assert.IsNotNull(testingTarget, "Should be not null!");
163 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
167 testingTarget.GetTransitionAt(0);
171 tlog.Error(tag, "Caught Exception" + e.ToString());
172 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
173 Assert.Fail("Caught Exception" + e.ToString());
177 tlog.Debug(tag, $"TransitionSetGetTransitionAt END (OK)");
182 [Description("TransitionSet GetTransitionCount.")]
183 [Property("SPEC", "Tizen.NUI.TransitionSet.GetTransitionCount M")]
184 [Property("SPEC_URL", "-")]
185 [Property("CRITERIA", "MR")]
186 [Property("AUTHOR", "guowei.wang@samsung.com")]
187 public void TransitionSetGetTransitionCount()
189 tlog.Debug(tag, $"TransitionSetGetTransitionCount START");
191 using (View view = new View())
193 var testingTarget = new TransitionSet(view.SwigCPtr.Handle, false);
194 Assert.IsNotNull(testingTarget, "Should be not null!");
195 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
199 testingTarget.GetTransitionCount();
203 tlog.Error(tag, "Caught Exception" + e.ToString());
204 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
205 Assert.Fail("Caught Exception" + e.ToString());
209 tlog.Debug(tag, $"TransitionSetGetTransitionCount END (OK)");
214 [Description("TransitionSet Play.")]
215 [Property("SPEC", "Tizen.NUI.TransitionSet.Play M")]
216 [Property("SPEC_URL", "-")]
217 [Property("CRITERIA", "MR")]
218 [Property("AUTHOR", "guowei.wang@samsung.com")]
219 public void TransitionSetPlay()
221 tlog.Debug(tag, $"TransitionSetPlay START");
223 using (View view = new View())
225 var testingTarget = new TransitionSet(view.SwigCPtr.Handle, false);
226 Assert.IsNotNull(testingTarget, "Should be not null!");
227 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
231 testingTarget.Play();
235 tlog.Error(tag, "Caught Exception" + e.ToString());
236 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
237 Assert.Fail("Caught Exception" + e.ToString());
241 tlog.Debug(tag, $"TransitionSetPlay END (OK)");
246 [Description("TransitionSet Assign.")]
247 [Property("SPEC", "Tizen.NUI.TransitionSet.Assign M")]
248 [Property("SPEC_URL", "-")]
249 [Property("CRITERIA", "MR")]
250 [Property("AUTHOR", "guowei.wang@samsung.com")]
251 public void TransitionSetAssign()
253 tlog.Debug(tag, $"TransitionSetAssign START");
255 using (View view = new View())
257 var testingTarget = new TransitionSet(view.SwigCPtr.Handle, false);
258 Assert.IsNotNull(testingTarget, "Should be not null!");
259 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
263 testingTarget.Assign(testingTarget);
267 tlog.Error(tag, "Caught Exception" + e.ToString());
268 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
269 Assert.Fail("Caught Exception" + e.ToString());
273 tlog.Debug(tag, $"TransitionSetAssign END (OK)");
278 [Description("TransitionSet FinishedSignal.")]
279 [Property("SPEC", "Tizen.NUI.TransitionSet.FinishedSignal M")]
280 [Property("SPEC_URL", "-")]
281 [Property("CRITERIA", "MR")]
282 [Property("AUTHOR", "guowei.wang@samsung.com")]
283 public void TransitionSetFinishedSignal()
285 tlog.Debug(tag, $"TransitionSetFinishedSignal START");
287 using (View view = new View())
289 var testingTarget = new TransitionSet(view.SwigCPtr.Handle, false);
290 Assert.IsNotNull(testingTarget, "Should be not null!");
291 Assert.IsInstanceOf<TransitionSet>(testingTarget, "Should be an Instance of TransitionSet!");
295 testingTarget.FinishedSignal();
299 tlog.Error(tag, "Caught Exception" + e.ToString());
300 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
301 Assert.Fail("Caught Exception" + e.ToString());
305 tlog.Debug(tag, $"TransitionSetFinishedSignal END (OK)");