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/Layouting/ILayoutParent")]
14 public class PublicILayoutParentTest
16 private const string tag = "NUITEST";
17 private static bool flagOnILayoutParentAdd;
18 private static bool flagOnILayoutParentRemove;
23 tlog.Info(tag, "Init() is called!");
29 tlog.Info(tag, "Destroy() is called!");
32 internal class MyILayoutParent : ILayoutParent
34 public MyILayoutParent() : base()
37 public void Add(LayoutItem layoutItem)
39 flagOnILayoutParentAdd = true;
42 public void Remove(LayoutItem layoutItem)
44 flagOnILayoutParentRemove = true;
50 [Description("ILayoutParent Add")]
51 [Property("SPEC", "Tizen.NUI.ILayoutParent.Add M")]
52 [Property("SPEC_URL", "-")]
53 [Property("CRITERIA", "MR")]
54 [Property("AUTHOR", "guowei.wang@samsung.com")]
55 public void ILayoutParentAdd()
57 tlog.Debug(tag, $"ILayoutParentAdd START");
59 flagOnILayoutParentAdd = false;
60 Assert.False(flagOnILayoutParentAdd, "flagOnILayoutParentAdd should be false initial");
62 var testingTarget = new MyILayoutParent();
63 Assert.IsNotNull(testingTarget, "null handle");
64 Assert.IsInstanceOf<ILayoutParent>(testingTarget, "Should be an instance of ILayoutParent type.");
66 using (LayoutItem layoutItem = new LayoutItem())
68 testingTarget.Add(layoutItem);
69 Assert.IsTrue(flagOnILayoutParentAdd);
72 tlog.Debug(tag, $"ILayoutParentAdd END (OK)");
77 [Description("ILayoutParent Remove")]
78 [Property("SPEC", "Tizen.NUI.ILayoutParent.Remove M")]
79 [Property("SPEC_URL", "-")]
80 [Property("CRITERIA", "MR")]
81 [Property("AUTHOR", "guowei.wang@samsung.com")]
82 public void ILayoutParentRemove()
84 tlog.Debug(tag, $"ILayoutParentRemove START");
86 flagOnILayoutParentAdd = false;
87 Assert.False(flagOnILayoutParentAdd, "flagOnILayoutParentAdd should be false initial");
89 flagOnILayoutParentRemove = false;
90 Assert.False(flagOnILayoutParentRemove, "flagOnILayoutParentRemove should be false initial");
92 var testingTarget = new MyILayoutParent();
93 Assert.IsNotNull(testingTarget, "null handle");
94 Assert.IsInstanceOf<ILayoutParent>(testingTarget, "Should be an instance of ILayoutParent type.");
96 using (LayoutItem layoutItem = new LayoutItem())
98 testingTarget.Add(layoutItem);
99 Assert.IsTrue(flagOnILayoutParentAdd);
101 testingTarget.Remove(layoutItem);
102 Assert.IsTrue(flagOnILayoutParentRemove);
105 tlog.Debug(tag, $"ILayoutParentRemove END (OK)");