3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Collections.Generic;
8 namespace Tizen.NUI.Devel.Tests
10 using tlog = Tizen.Log;
13 [Description("public/Widget/WidgetView")]
14 public class PublicWidgetViewTest
16 private const string tag = "NUITEST";
17 private View view = null;
18 private WidgetView widgetView = null;
23 tlog.Info(tag, "Init() is called!");
27 Size = new Size(100, 200),
30 widgetView = new WidgetView(view.SwigCPtr.Handle, false);
31 tlog.Error(tag, " widgetView.ID : " + widgetView.ID);
40 widgetView?.Dispose();
43 tlog.Info(tag, "Destroy() is called!");
48 [Description("WidgetView Constructor. With WidgetView")]
49 [Property("SPEC", "Tizen.NUI.WidgetView.WidgetView C")]
50 [Property("SPEC_URL", "-")]
51 [Property("CRITERIA", "CONSTR")]
52 [Property("AUTHOR", "guowei.wang@samsung.com")]
53 public void WidgetViewConstructorWithWidgetView()
55 tlog.Debug(tag, $"WidgetViewConstructorWithWidgetView START");
57 var testingTarget = new WidgetView(widgetView);
58 Assert.IsNotNull(testingTarget, "Can't create success object WidgetView");
59 Assert.IsInstanceOf<WidgetView>(testingTarget, "Should be an instance of WidgetView type.");
61 testingTarget.Dispose();
62 tlog.Debug(tag, $"WidgetViewConstructorWithWidgetView END (OK)");
67 [Description("WidgetView WidgetAddedSignal.")]
68 [Property("SPEC", "Tizen.NUI.WidgetView.WidgetAddedSignal M")]
69 [Property("SPEC_URL", "-")]
70 [Property("CRITERIA", "MR")]
71 [Property("AUTHOR", "guowei.wang@samsung.com")]
72 public void WidgetViewWidgetAddedSignal()
74 tlog.Debug(tag, $"WidgetViewWidgetAddedSignal START");
78 widgetView.WidgetAddedSignal();
82 tlog.Debug(tag, e.Message.ToString());
83 Assert.Fail("Caught Exception: Failed!");
86 tlog.Debug(tag, $"WidgetViewWidgetAddedSignal END (OK)");
91 [Description("WidgetView WidgetDeletedSignal.")]
92 [Property("SPEC", "Tizen.NUI.WidgetView.WidgetDeletedSignal M")]
93 [Property("SPEC_URL", "-")]
94 [Property("CRITERIA", "MR")]
95 [Property("AUTHOR", "guowei.wang@samsung.com")]
96 public void WidgetViewWidgetDeletedSignal()
98 tlog.Debug(tag, $"WidgetViewWidgetDeletedSignal START");
102 widgetView.WidgetDeletedSignal();
106 tlog.Debug(tag, e.Message.ToString());
107 Assert.Fail("Caught Exception: Failed!");
110 tlog.Debug(tag, $"WidgetViewWidgetDeletedSignal END (OK)");
115 [Description("WidgetView WidgetCreationAbortedSignal.")]
116 [Property("SPEC", "Tizen.NUI.WidgetView.WidgetCreationAbortedSignal M")]
117 [Property("SPEC_URL", "-")]
118 [Property("CRITERIA", "MR")]
119 [Property("AUTHOR", "guowei.wang@samsung.com")]
120 public void WidgetViewWidgetCreationAbortedSignal()
122 tlog.Debug(tag, $"WidgetViewWidgetCreationAbortedSignal START");
126 widgetView.WidgetCreationAbortedSignal();
130 tlog.Debug(tag, e.Message.ToString());
131 Assert.Fail("Caught Exception: Failed!");
134 tlog.Debug(tag, $"WidgetViewWidgetCreationAbortedSignal END (OK)");
139 [Description("WidgetView WidgetContentUpdatedSignal.")]
140 [Property("SPEC", "Tizen.NUI.WidgetView.WidgetContentUpdatedSignal M")]
141 [Property("SPEC_URL", "-")]
142 [Property("CRITERIA", "MR")]
143 [Property("AUTHOR", "guowei.wang@samsung.com")]
144 public void WidgetViewWidgetContentUpdatedSignal()
146 tlog.Debug(tag, $"WidgetViewWidgetContentUpdatedSignal START");
150 widgetView.WidgetContentUpdatedSignal();
154 tlog.Debug(tag, e.Message.ToString());
155 Assert.Fail("Caught Exception: Failed!");
158 tlog.Debug(tag, $"WidgetViewWidgetContentUpdatedSignal END (OK)");
163 [Description("WidgetView WidgetUpdatePeriodChangedSignal.")]
164 [Property("SPEC", "Tizen.NUI.WidgetView.WidgetUpdatePeriodChangedSignal M")]
165 [Property("SPEC_URL", "-")]
166 [Property("CRITERIA", "MR")]
167 [Property("AUTHOR", "guowei.wang@samsung.com")]
168 public void WidgetViewWidgetUpdatePeriodChangedSignal()
170 tlog.Debug(tag, $"WidgetViewWidgetUpdatePeriodChangedSignal START");
174 widgetView.WidgetUpdatePeriodChangedSignal();
178 tlog.Debug(tag, e.Message.ToString());
179 Assert.Fail("Caught Exception: Failed!");
182 tlog.Debug(tag, $"WidgetViewWidgetUpdatePeriodChangedSignal END (OK)");
187 [Description("WidgetView WidgetFaultedSignal.")]
188 [Property("SPEC", "Tizen.NUI.WidgetView.WidgetFaultedSignal M")]
189 [Property("SPEC_URL", "-")]
190 [Property("CRITERIA", "MR")]
191 [Property("AUTHOR", "guowei.wang@samsung.com")]
192 public void WidgetViewWidgetFaultedSignal()
194 tlog.Debug(tag, $"WidgetViewWidgetFaultedSignal START");
198 widgetView.WidgetFaultedSignal();
202 tlog.Debug(tag, e.Message.ToString());
203 Assert.Fail("Caught Exception: Failed!");
206 tlog.Debug(tag, $"WidgetViewWidgetFaultedSignal END (OK)");
211 [Description("WidgetView WidgetID.")]
212 [Property("SPEC", "Tizen.NUI.WidgetView.WidgetID A")]
213 [Property("SPEC_URL", "-")]
214 [Property("CRITERIA", "PRO")]
215 [Property("AUTHOR", "guowei.wang@samsung.com")]
216 public void WidgetViewWidgetID()
218 tlog.Debug(tag, $"WidgetViewWidgetID START");
222 tlog.Debug(tag, "widgetView.WidgetID : " + widgetView.WidgetID);
226 tlog.Debug(tag, e.Message.ToString());
227 Assert.Fail("Caught Exception: Failed!");
230 tlog.Debug(tag, $"WidgetViewWidgetID END (OK)");
235 [Description("WidgetView InstanceID.")]
236 [Property("SPEC", "Tizen.NUI.WidgetView.InstanceID A")]
237 [Property("SPEC_URL", "-")]
238 [Property("CRITERIA", "PRO")]
239 [Property("AUTHOR", "guowei.wang@samsung.com")]
240 public void WidgetViewInstanceID()
242 tlog.Debug(tag, $"WidgetViewInstanceID START");
246 tlog.Debug(tag, "widgetView.InstanceID : " + widgetView.InstanceID);
250 tlog.Debug(tag, e.Message.ToString());
251 Assert.Fail("Caught Exception: Failed!");
254 tlog.Debug(tag, $"WidgetViewInstanceID END (OK)");
259 [Description("WidgetView ContentInfo.")]
260 [Property("SPEC", "Tizen.NUI.WidgetView.ContentInfo A")]
261 [Property("SPEC_URL", "-")]
262 [Property("CRITERIA", "PRO")]
263 [Property("AUTHOR", "guowei.wang@samsung.com")]
264 public void WidgetViewContentInfo()
266 tlog.Debug(tag, $"WidgetViewContentInfo START");
270 tlog.Debug(tag, "widgetView.ContentInfo : " + widgetView.ContentInfo);
274 tlog.Debug(tag, e.Message.ToString());
275 Assert.Fail("Caught Exception: Failed!");
278 tlog.Debug(tag, $"WidgetViewContentInfo END (OK)");
283 [Description("WidgetView Title.")]
284 [Property("SPEC", "Tizen.NUI.WidgetView.Title A")]
285 [Property("SPEC_URL", "-")]
286 [Property("CRITERIA", "PRO")]
287 [Property("AUTHOR", "guowei.wang@samsung.com")]
288 public void WidgetViewTitle()
290 tlog.Debug(tag, $"WidgetViewTitle START");
294 tlog.Debug(tag, "widgetView.Title : " + widgetView.Title);
298 tlog.Debug(tag, e.Message.ToString());
299 Assert.Fail("Caught Exception: Failed!");
302 tlog.Debug(tag, $"WidgetViewTitle END (OK)");
307 [Description("WidgetView UpdatePeriod.")]
308 [Property("SPEC", "Tizen.NUI.WidgetView.Title A")]
309 [Property("SPEC_URL", "-")]
310 [Property("CRITERIA", "PRO")]
311 [Property("AUTHOR", "guowei.wang@samsung.com")]
312 public void WidgetViewUpdatePeriod()
314 tlog.Debug(tag, $"WidgetViewUpdatePeriod START");
318 tlog.Debug(tag, "widgetView.UpdatePeriod : " + widgetView.UpdatePeriod);
322 tlog.Debug(tag, e.Message.ToString());
323 Assert.Fail("Caught Exception: Failed!");
326 tlog.Debug(tag, $"WidgetViewUpdatePeriod END (OK)");
331 [Description("WidgetView Preview.")]
332 [Property("SPEC", "Tizen.NUI.WidgetView.Preview A")]
333 [Property("SPEC_URL", "-")]
334 [Property("CRITERIA", "PRW")]
335 [Property("AUTHOR", "guowei.wang@samsung.com")]
336 public void WidgetViewPreview()
338 tlog.Debug(tag, $"WidgetViewPreview START");
342 tlog.Debug(tag, "Default widgetView.Preview is : " + widgetView.Preview);
344 widgetView.Preview = true;
345 tlog.Debug(tag, "widgetView.Preview : " + widgetView.Preview);
347 widgetView.Preview = false;
348 tlog.Debug(tag, "widgetView.Preview : " + widgetView.Preview);
352 tlog.Debug(tag, e.Message.ToString());
353 Assert.Fail("Caught Exception: Failed!");
356 tlog.Debug(tag, $"WidgetViewPreview END (OK)");
361 [Description("WidgetView LoadingText.")]
362 [Property("SPEC", "Tizen.NUI.WidgetView.LoadingText A")]
363 [Property("SPEC_URL", "-")]
364 [Property("CRITERIA", "PRW")]
365 [Property("AUTHOR", "guowei.wang@samsung.com")]
366 public void WidgetViewLoadingText()
368 tlog.Debug(tag, $"WidgetViewLoadingText START");
372 tlog.Debug(tag, "Default widgetView.Preview is : " + widgetView.LoadingText);
374 widgetView.LoadingText = true;
375 tlog.Debug(tag, "widgetView.LoadingText : " + widgetView.LoadingText);
377 widgetView.LoadingText = false;
378 tlog.Debug(tag, "widgetView.LoadingText : " + widgetView.LoadingText);
382 tlog.Debug(tag, e.Message.ToString());
383 Assert.Fail("Caught Exception: Failed!");
386 tlog.Debug(tag, $"WidgetViewLoadingText END (OK)");
391 [Description("WidgetView WidgetStateFaulted.")]
392 [Property("SPEC", "Tizen.NUI.WidgetView.WidgetStateFaulted A")]
393 [Property("SPEC_URL", "-")]
394 [Property("CRITERIA", "PRW")]
395 [Property("AUTHOR", "guowei.wang@samsung.com")]
396 public void WidgetViewWidgetStateFaulted()
398 tlog.Debug(tag, $"WidgetViewWidgetStateFaulted START");
402 tlog.Debug(tag, "Default widgetView.Preview is : " + widgetView.WidgetStateFaulted);
404 widgetView.WidgetStateFaulted = true;
405 tlog.Debug(tag, "widgetView.WidgetStateFaulted : " + widgetView.WidgetStateFaulted);
407 widgetView.WidgetStateFaulted = false;
408 tlog.Debug(tag, "widgetView.WidgetStateFaulted : " + widgetView.WidgetStateFaulted);
412 tlog.Debug(tag, e.Message.ToString());
413 Assert.Fail("Caught Exception: Failed!");
416 tlog.Debug(tag, $"WidgetViewWidgetStateFaulted END (OK)");
421 [Description("WidgetView PermanentDelete.")]
422 [Property("SPEC", "Tizen.NUI.WidgetView.PermanentDelete A")]
423 [Property("SPEC_URL", "-")]
424 [Property("CRITERIA", "PRW")]
425 [Property("AUTHOR", "guowei.wang@samsung.com")]
426 public void WidgetViewWidgetPermanentDelete()
428 tlog.Debug(tag, $"WidgetViewWidgetPermanentDelete START");
432 tlog.Debug(tag, "Default widgetView.Preview is : " + widgetView.PermanentDelete);
434 widgetView.PermanentDelete = true;
435 tlog.Debug(tag, "widgetView.PermanentDelete : " + widgetView.PermanentDelete);
437 widgetView.PermanentDelete = false;
438 tlog.Debug(tag, "widgetView.PermanentDelete : " + widgetView.PermanentDelete);
442 tlog.Debug(tag, e.Message.ToString());
443 Assert.Fail("Caught Exception: Failed!");
446 tlog.Debug(tag, $"WidgetViewWidgetPermanentDelete END (OK)");
451 [Description("WidgetView RetryText.")]
452 [Property("SPEC", "Tizen.NUI.WidgetView.RetryText A")]
453 [Property("SPEC_URL", "-")]
454 [Property("CRITERIA", "PRW")]
455 [Property("AUTHOR", "guowei.wang@samsung.com")]
456 public void WidgetViewRetryText()
458 tlog.Debug(tag, $"WidgetViewRetryText START");
462 using (PropertyMap map = new PropertyMap())
464 map.Insert(WidgetView.Property.RetryText, new PropertyValue(1));
466 widgetView.RetryText = map;
468 var result = widgetView.RetryText;
469 Assert.IsInstanceOf<PropertyMap>(result, "Should be an instance of PropertyMap type.");
474 tlog.Debug(tag, e.Message.ToString());
475 Assert.Fail("Caught Exception: Failed!");
478 tlog.Debug(tag, $"WidgetViewRetryText END (OK)");
483 [Description("WidgetView Effect.")]
484 [Property("SPEC", "Tizen.NUI.WidgetView.Effect A")]
485 [Property("SPEC_URL", "-")]
486 [Property("CRITERIA", "PRW")]
487 [Property("AUTHOR", "guowei.wang@samsung.com")]
488 public void WidgetViewEffect()
490 tlog.Debug(tag, $"WidgetViewEffect START");
494 using (PropertyMap map = new PropertyMap())
496 map.Insert(WidgetView.Property.EFFECT, new PropertyValue(1));
498 widgetView.Effect = map;
500 var result = widgetView.Effect;
501 Assert.IsInstanceOf<PropertyMap>(result, "Should be an instance of PropertyMap type.");
506 tlog.Debug(tag, e.Message.ToString());
507 Assert.Fail("Caught Exception: Failed!");
510 tlog.Debug(tag, $"WidgetViewEffect END (OK)");
515 [Description("WidgetView GetWidgetViewFromPtr.")]
516 [Property("SPEC", "Tizen.NUI.WidgetView.GetWidgetViewFromPtr M")]
517 [Property("SPEC_URL", "-")]
518 [Property("CRITERIA", "MR")]
519 [Property("AUTHOR", "guowei.wang@samsung.com")]
520 public void WidgetViewGetWidgetViewFromPtr()
522 tlog.Debug(tag, $"WidgetViewGetWidgetViewFromPtr START");
526 WidgetView.GetWidgetViewFromPtr(widgetView.SwigCPtr.Handle);
530 tlog.Debug(tag, e.Message.ToString());
531 Assert.Fail("Caught Exception: Failed!");
534 tlog.Debug(tag, $"WidgetViewGetWidgetViewFromPtr END (OK)");
539 [Description("WidgetView Assign.")]
540 [Property("SPEC", "Tizen.NUI.WidgetView.Assign M")]
541 [Property("SPEC_URL", "-")]
542 [Property("CRITERIA", "MR")]
543 [Property("AUTHOR", "guowei.wang@samsung.com")]
544 public void WidgetViewAssign()
546 tlog.Debug(tag, $"WidgetViewAssign START");
550 widgetView.Assign(widgetView);
554 tlog.Debug(tag, e.Message.ToString());
555 Assert.Fail("Caught Exception: Failed!");
558 tlog.Debug(tag, $"WidgetViewAssign END (OK)");
563 [Description("WidgetView.WidgetViewEventArgs.WidgetView.")]
564 [Property("SPEC", "Tizen.NUI.WidgetView.WidgetViewEventArgs.WidgetView M")]
565 [Property("SPEC_URL", "-")]
566 [Property("CRITERIA", "MR")]
567 [Property("AUTHOR", "guowei.wang@samsung.com")]
568 public void WidgetViewWidgetViewEventArgsWidgetView()
570 tlog.Debug(tag, $"WidgetViewWidgetViewEventArgsWidgetView START");
572 var testingTarget = new WidgetView.WidgetViewEventArgs();
573 tlog.Debug(tag, "Default testingTarget.WidgetView is : " + testingTarget.WidgetView);
575 testingTarget.WidgetView = widgetView;
576 tlog.Debug(tag, "testingTarget.WidgetView is : " + testingTarget.WidgetView);
578 tlog.Debug(tag, $"WidgetViewWidgetViewEventArgsWidgetView END (OK)");
583 [Description("WidgetView ActivateFaultedWidget.")]
584 [Property("SPEC", "Tizen.NUI.WidgetView.ActivateFaultedWidget M")]
585 [Property("SPEC_URL", "-")]
586 [Property("CRITERIA", "MR")]
587 [Property("AUTHOR", "guowei.wang@samsung.com")]
588 public void WidgetViewActivateFaultedWidget()
590 tlog.Debug(tag, $"WidgetViewActivateFaultedWidget START");
594 widgetView.ActivateFaultedWidget();
598 tlog.Debug(tag, e.Message.ToString());
599 Assert.Fail("Caught Exception: Failed!");
602 tlog.Debug(tag, $"WidgetViewActivateFaultedWidget END (OK)");