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/Widget/WidgetImpl")]
13 public class PublicWidgetImplTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("WidgetImpl.WIdgetInstanceOnCreateArgs.ContentInfo.")]
32 [Property("SPEC", "Tizen.NUI.WidgetImpl.WIdgetInstanceOnCreateArgs.ContentInfo A")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "PRW")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void WidgetImplWIdgetInstanceOnCreateArgsContentInfo()
38 tlog.Debug(tag, $"WidgetImplWIdgetInstanceOnCreateArgsContentInfo START");
40 var testingTarget = new WidgetImpl.WIdgetInstanceOnCreateArgs();
41 Assert.IsNotNull(testingTarget, "Can't create success object WIdgetInstanceOnCreateArgs");
42 Assert.IsInstanceOf<WidgetImpl.WIdgetInstanceOnCreateArgs>(testingTarget, "Should be an instance of WIdgetInstanceOnCreateArgs type.");
44 tlog.Debug(tag, "Default testingTarget.ContentInfo is : " + testingTarget.ContentInfo);
46 testingTarget.ContentInfo = "WidgetImpl";
47 tlog.Debug(tag, "testingTarget.ContentInfo : " + testingTarget.ContentInfo);
49 tlog.Debug(tag, $"WidgetImplWIdgetInstanceOnCreateArgsContentInfo END (OK)");
54 [Description("WidgetImpl.WIdgetInstanceOnCreateArgs.Window.")]
55 [Property("SPEC", "Tizen.NUI.WidgetImpl.WIdgetInstanceOnCreateArgs.Window A")]
56 [Property("SPEC_URL", "-")]
57 [Property("CRITERIA", "PRW")]
58 [Property("AUTHOR", "guowei.wang@samsung.com")]
59 public void WidgetImplWIdgetInstanceOnCreateArgsWindow()
61 tlog.Debug(tag, $"WidgetImplWIdgetInstanceOnCreateArgsWindow START");
63 var testingTarget = new WidgetImpl.WIdgetInstanceOnCreateArgs();
64 Assert.IsNotNull(testingTarget, "Can't create success object WIdgetInstanceOnCreateArgs");
65 Assert.IsInstanceOf<WidgetImpl.WIdgetInstanceOnCreateArgs>(testingTarget, "Should be an instance of WIdgetInstanceOnCreateArgs type.");
67 tlog.Debug(tag, "Default testingTarget.Window is : " + testingTarget.Window);
69 testingTarget.Window = Window.Instance;
70 tlog.Debug(tag, "testingTarget.Window : " + testingTarget.Window);
72 tlog.Debug(tag, $"WidgetImplWIdgetInstanceOnCreateArgsWindow END (OK)");
77 [Description("WidgetImpl.WIdgetInstanceOnDestroyArgs.ContentInfo.")]
78 [Property("SPEC", "Tizen.NUI.WidgetImpl.WIdgetInstanceOnDestroyArgs.ContentInfo A")]
79 [Property("SPEC_URL", "-")]
80 [Property("CRITERIA", "PRW")]
81 [Property("AUTHOR", "guowei.wang@samsung.com")]
82 public void WidgetImplWIdgetInstanceOnDestroyArgsContentInfo()
84 tlog.Debug(tag, $"WidgetImplWIdgetInstanceOnDestroyArgsContentInfo START");
86 var testingTarget = new WidgetImpl.WIdgetInstanceOnDestroyArgs();
87 Assert.IsNotNull(testingTarget, "Can't create success object WIdgetInstanceOnDestroyArgs");
88 Assert.IsInstanceOf<WidgetImpl.WIdgetInstanceOnDestroyArgs>(testingTarget, "Should be an instance of WIdgetInstanceOnDestroyArgs type.");
90 tlog.Debug(tag, "Default testingTarget.ContentInfo is : " + testingTarget.ContentInfo);
92 testingTarget.ContentInfo = "WIdgetInstanceOnDestroyArgs";
93 tlog.Debug(tag, "testingTarget.ContentInfo : " + testingTarget.ContentInfo);
95 tlog.Debug(tag, $"WidgetImplWIdgetInstanceOnDestroyArgsContentInfo END (OK)");
100 [Description("WidgetImpl.WIdgetInstanceOnDestroyArgs.TerminateType.")]
101 [Property("SPEC", "Tizen.NUI.WidgetImpl.WIdgetInstanceOnDestroyArgs.TerminateType A")]
102 [Property("SPEC_URL", "-")]
103 [Property("CRITERIA", "PRW")]
104 [Property("AUTHOR", "guowei.wang@samsung.com")]
105 public void WidgetImplWIdgetInstanceOnDestroyArgsTerminateType()
107 tlog.Debug(tag, $"WidgetImplWIdgetInstanceOnDestroyArgsTerminateType START");
109 var testingTarget = new WidgetImpl.WIdgetInstanceOnDestroyArgs();
110 Assert.IsNotNull(testingTarget, "Can't create success object WIdgetInstanceOnDestroyArgs");
111 Assert.IsInstanceOf<WidgetImpl.WIdgetInstanceOnDestroyArgs>(testingTarget, "Should be an instance of WIdgetInstanceOnDestroyArgs type.");
113 tlog.Debug(tag, "Default testingTarget.TerminateType is : " + testingTarget.TerminateType);
115 testingTarget.TerminateType = Widget.TerminationType.Permanent;
116 tlog.Debug(tag, "testingTarget.TerminateType : " + testingTarget.TerminateType);
118 testingTarget.TerminateType = Widget.TerminationType.Temporary;
119 tlog.Debug(tag, "testingTarget.TerminateType : " + testingTarget.TerminateType);
121 tlog.Debug(tag, $"WidgetImplWIdgetInstanceOnDestroyArgsTerminateType END (OK)");
126 [Description("WidgetImpl.WidgetInstanceOnResizeArgs.Window.")]
127 [Property("SPEC", "Tizen.NUI.WidgetImpl.WidgetInstanceOnResizeArgs.Window A")]
128 [Property("SPEC_URL", "-")]
129 [Property("CRITERIA", "PRW")]
130 [Property("AUTHOR", "guowei.wang@samsung.com")]
131 public void WidgetImplWidgetInstanceOnResizeArgsWindow()
133 tlog.Debug(tag, $"WidgetImplWidgetInstanceOnResizeArgsWindow START");
135 var testingTarget = new WidgetImpl.WidgetInstanceOnResizeArgs();
136 Assert.IsNotNull(testingTarget, "Can't create success object WidgetInstanceOnResizeArgs");
137 Assert.IsInstanceOf<WidgetImpl.WidgetInstanceOnResizeArgs>(testingTarget, "Should be an instance of WidgetInstanceOnResizeArgs type.");
139 tlog.Debug(tag, "Default testingTarget.Window is : " + testingTarget.Window);
141 testingTarget.Window = Window.Instance;
142 tlog.Debug(tag, "testingTarget.Window : " + testingTarget.Window);
144 tlog.Debug(tag, $"WidgetImplWidgetInstanceOnResizeArgsWindow END (OK)");
149 [Description("WidgetImpl.WidgetInstanceOnUpdateArgs.ContentInfo.")]
150 [Property("SPEC", "Tizen.NUI.WidgetImpl.WidgetInstanceOnUpdateArgs.ContentInfo A")]
151 [Property("SPEC_URL", "-")]
152 [Property("CRITERIA", "PRW")]
153 [Property("AUTHOR", "guowei.wang@samsung.com")]
154 public void WidgetImplWidgetInstanceOnUpdateArgsContentInfo()
156 tlog.Debug(tag, $"WidgetImplWidgetInstanceOnUpdateArgsContentInfo START");
158 var testingTarget = new WidgetImpl.WidgetInstanceOnUpdateArgs();
159 Assert.IsNotNull(testingTarget, "Can't create success object WidgetInstanceOnUpdateArgs");
160 Assert.IsInstanceOf<WidgetImpl.WidgetInstanceOnUpdateArgs>(testingTarget, "Should be an instance of WidgetInstanceOnUpdateArgs type.");
162 tlog.Debug(tag, "Default testingTarget.ContentInfo is : " + testingTarget.ContentInfo);
164 testingTarget.ContentInfo = "WidgetInstanceOnUpdateArgs";
165 tlog.Debug(tag, "testingTarget.ContentInfo : " + testingTarget.ContentInfo);
167 tlog.Debug(tag, $"WidgetImplWidgetInstanceOnUpdateArgsContentInfo END (OK)");
172 [Description("WidgetImpl.WidgetInstanceOnUpdateArgs.Force.")]
173 [Property("SPEC", "Tizen.NUI.WidgetImpl.WidgetInstanceOnUpdateArgs.Force A")]
174 [Property("SPEC_URL", "-")]
175 [Property("CRITERIA", "PRW")]
176 [Property("AUTHOR", "guowei.wang@samsung.com")]
177 public void WidgetImplWidgetInstanceOnUpdateArgsForce()
179 tlog.Debug(tag, $"WidgetImplWidgetInstanceOnUpdateArgsForce START");
181 var testingTarget = new WidgetImpl.WidgetInstanceOnUpdateArgs();
182 Assert.IsNotNull(testingTarget, "Can't create success object WidgetInstanceOnUpdateArgs");
183 Assert.IsInstanceOf<WidgetImpl.WidgetInstanceOnUpdateArgs>(testingTarget, "Should be an instance of WidgetInstanceOnUpdateArgs type.");
185 tlog.Debug(tag, "Default testingTarget.Force is : " + testingTarget.Force);
187 testingTarget.Force = 0;
188 tlog.Debug(tag, "testingTarget.Force : " + testingTarget.Force);
190 tlog.Debug(tag, $"WidgetImplWidgetInstanceOnUpdateArgsForce END (OK)");
195 [Description("WidgetImpl.SetImpl.")]
196 [Property("SPEC", "Tizen.NUI.WidgetImpl.SetImpl M")]
197 [Property("SPEC_URL", "-")]
198 [Property("CRITERIA", "MR")]
199 [Property("AUTHOR", "guowei.wang@samsung.com")]
200 public void WidgetImplSetImpl()
202 tlog.Debug(tag, $"WidgetImplSetImpl START");
204 var testingTarget = new WidgetImpl();
205 Assert.IsNotNull(testingTarget, "Can't create success object WidgetImpl");
206 Assert.IsInstanceOf<WidgetImpl>(testingTarget, "Should be an instance of WidgetImpl type.");
208 Widget widget = new Widget();
212 testingTarget.SetImpl(new SWIGTYPE_p_Dali__Widget__Impl(widget.GetIntPtr()));
216 tlog.Debug(tag, e.Message.ToString());
217 Assert.Fail("Caught Exception: Failed!");
223 testingTarget.Dispose();
224 testingTarget = null;
225 tlog.Debug(tag, $"WidgetImplSetImpl END (OK)");
230 [Description("WidgetImpl.OnCreate.")]
231 [Property("SPEC", "Tizen.NUI.WidgetImpl.OnCreate M")]
232 [Property("SPEC_URL", "-")]
233 [Property("CRITERIA", "MR")]
234 [Property("AUTHOR", "guowei.wang@samsung.com")]
235 public void WidgetImplOnCreate()
237 tlog.Debug(tag, $"WidgetImplOnCreate START");
239 var testingTarget = new WidgetImpl();
240 Assert.IsNotNull(testingTarget, "Can't create success object WidgetImpl");
241 Assert.IsInstanceOf<WidgetImpl>(testingTarget, "Should be an instance of WidgetImpl type.");
245 testingTarget.OnCreate("WidgetImplOnCreate", Window.Instance);
249 tlog.Debug(tag, e.Message.ToString());
250 Assert.Fail("Caught Exception: Failed!");
253 testingTarget.Dispose();
254 testingTarget = null;
255 tlog.Debug(tag, $"WidgetImplOnCreate END (OK)");
260 [Description("WidgetImpl.OnTerminate. Type is Permanent.")]
261 [Property("SPEC", "Tizen.NUI.WidgetImpl.OnTerminate M")]
262 [Property("SPEC_URL", "-")]
263 [Property("CRITERIA", "MR")]
264 [Property("AUTHOR", "guowei.wang@samsung.com")]
265 public void WidgetImplOnTerminatePermanent()
267 tlog.Debug(tag, $"WidgetImplOnTerminatePermanent START");
269 var testingTarget = new WidgetImpl();
270 Assert.IsNotNull(testingTarget, "Can't create success object WidgetImpl");
271 Assert.IsInstanceOf<WidgetImpl>(testingTarget, "Should be an instance of WidgetImpl type.");
275 testingTarget.OnTerminate("WidgetImplOnTerminate", Widget.TerminationType.Permanent);
279 tlog.Debug(tag, e.Message.ToString());
280 Assert.Fail("Caught Exception: Failed!");
283 testingTarget.Dispose();
284 testingTarget = null;
285 tlog.Debug(tag, $"WidgetImplOnTerminatePermanent END (OK)");
290 [Description("WidgetImpl.OnTerminate. Type is Temporary.")]
291 [Property("SPEC", "Tizen.NUI.WidgetImpl.OnTerminate M")]
292 [Property("SPEC_URL", "-")]
293 [Property("CRITERIA", "MR")]
294 [Property("AUTHOR", "guowei.wang@samsung.com")]
295 public void WidgetImplOnTerminateTemporary()
297 tlog.Debug(tag, $"WidgetImplOnTerminateTemporary START");
299 var testingTarget = new WidgetImpl();
300 Assert.IsNotNull(testingTarget, "Can't create success object WidgetImpl");
301 Assert.IsInstanceOf<WidgetImpl>(testingTarget, "Should be an instance of WidgetImpl type.");
305 testingTarget.OnTerminate("WidgetImplOnTerminate", Widget.TerminationType.Temporary);
309 tlog.Debug(tag, e.Message.ToString());
310 Assert.Fail("Caught Exception: Failed!");
313 testingTarget.Dispose();
314 testingTarget = null;
315 tlog.Debug(tag, $"WidgetImplOnTerminateTemporary END (OK)");
320 [Description("WidgetImpl.OnPause.")]
321 [Property("SPEC", "Tizen.NUI.WidgetImpl.OnPause M")]
322 [Property("SPEC_URL", "-")]
323 [Property("CRITERIA", "MR")]
324 [Property("AUTHOR", "guowei.wang@samsung.com")]
325 public void WidgetImplOnPause()
327 tlog.Debug(tag, $"WidgetImplOnPause START");
329 var testingTarget = new WidgetImpl();
330 Assert.IsNotNull(testingTarget, "Can't create success object WidgetImpl");
331 Assert.IsInstanceOf<WidgetImpl>(testingTarget, "Should be an instance of WidgetImpl type.");
335 testingTarget.OnPause();
339 tlog.Debug(tag, e.Message.ToString());
340 Assert.Fail("Caught Exception: Failed!");
343 testingTarget.Dispose();
344 testingTarget = null;
345 tlog.Debug(tag, $"WidgetImplOnPause END (OK)");
350 [Description("WidgetImpl.OnResume.")]
351 [Property("SPEC", "Tizen.NUI.WidgetImpl.OnResume M")]
352 [Property("SPEC_URL", "-")]
353 [Property("CRITERIA", "MR")]
354 [Property("AUTHOR", "guowei.wang@samsung.com")]
355 public void WidgetImplOnResume()
357 tlog.Debug(tag, $"WidgetImplOnResume START");
359 var testingTarget = new WidgetImpl();
360 Assert.IsNotNull(testingTarget, "Can't create success object WidgetImpl");
361 Assert.IsInstanceOf<WidgetImpl>(testingTarget, "Should be an instance of WidgetImpl type.");
365 testingTarget.OnResume();
369 tlog.Debug(tag, e.Message.ToString());
370 Assert.Fail("Caught Exception: Failed!");
373 testingTarget.Dispose();
374 testingTarget = null;
375 tlog.Debug(tag, $"WidgetImplOnResume END (OK)");
380 [Description("WidgetImpl.OnResize.")]
381 [Property("SPEC", "Tizen.NUI.WidgetImpl.OnResize M")]
382 [Property("SPEC_URL", "-")]
383 [Property("CRITERIA", "MR")]
384 [Property("AUTHOR", "guowei.wang@samsung.com")]
385 public void WidgetImplOnResize()
387 tlog.Debug(tag, $"WidgetImplOnResize START");
389 var testingTarget = new WidgetImpl();
390 Assert.IsNotNull(testingTarget, "Can't create success object WidgetImpl");
391 Assert.IsInstanceOf<WidgetImpl>(testingTarget, "Should be an instance of WidgetImpl type.");
395 testingTarget.OnResize(Window.Instance);
399 tlog.Debug(tag, e.Message.ToString());
400 Assert.Fail("Caught Exception: Failed!");
403 testingTarget.Dispose();
404 testingTarget = null;
405 tlog.Debug(tag, $"WidgetImplOnResize END (OK)");
410 [Description("WidgetImpl.OnUpdate.")]
411 [Property("SPEC", "Tizen.NUI.WidgetImpl.OnUpdate M")]
412 [Property("SPEC_URL", "-")]
413 [Property("CRITERIA", "MR")]
414 [Property("AUTHOR", "guowei.wang@samsung.com")]
415 public void WidgetImplOnUpdate()
417 tlog.Debug(tag, $"WidgetImplOnUpdate START");
419 var testingTarget = new WidgetImpl();
420 Assert.IsNotNull(testingTarget, "Can't create success object WidgetImpl");
421 Assert.IsInstanceOf<WidgetImpl>(testingTarget, "Should be an instance of WidgetImpl type.");
425 testingTarget.OnUpdate("WidgetImplOnUpdate", 0);
429 tlog.Debug(tag, e.Message.ToString());
430 Assert.Fail("Caught Exception: Failed!");
433 testingTarget.Dispose();
434 testingTarget = null;
435 tlog.Debug(tag, $"WidgetImplOnUpdate END (OK)");