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/Layouting/LayoutController")]
13 public class InternalLayoutControllerTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("LayoutController GetId.")]
32 [Property("SPEC", "Tizen.NUI.LayoutController.GetId M")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "MR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void LayoutControllerGetId()
38 tlog.Debug(tag, $"LayoutControllerGetId START");
40 var testingTarget = new LayoutController(Window.Instance);
41 Assert.IsNotNull(testingTarget, "Can't create success object LayoutController");
42 Assert.IsInstanceOf<LayoutController>(testingTarget, "Should be an instance of LayoutController type.");
44 tlog.Debug(tag, testingTarget.GetId().ToString());
46 testingTarget.Dispose();
48 testingTarget.Dispose();
49 tlog.Debug(tag, $"LayoutControllerGetId END (OK)");
54 [Description("LayoutController RequestLayout.")]
55 [Property("SPEC", "Tizen.NUI.LayoutController.RequestLayout M")]
56 [Property("SPEC_URL", "-")]
57 [Property("CRITERIA", "MR")]
58 [Property("AUTHOR", "guowei.wang@samsung.com")]
59 public void LayoutControllerRequestLayout()
61 tlog.Debug(tag, $"LayoutControllerRequestLayout START");
63 var testingTarget = new LayoutController(Window.Instance);
64 Assert.IsNotNull(testingTarget, "Can't create success object LayoutController");
65 Assert.IsInstanceOf<LayoutController>(testingTarget, "Should be an instance of LayoutController type.");
67 using (LayoutItem layoutItem = new LayoutItem())
69 using (View view = new View())
71 view.Name = "parentView";
72 layoutItem.AttachToOwner(view);
76 testingTarget.RequestLayout(layoutItem);
80 tlog.Debug(tag, e.Message.ToString());
81 Assert.Fail("Caught Exception : Failed!");
87 testingTarget.Dispose();
88 tlog.Debug(tag, $"LayoutControllerRequestLayout END (OK)");
93 [Description("LayoutController RequestLayout.")]
94 [Property("SPEC", "Tizen.NUI.LayoutController.RequestLayout M")]
95 [Property("SPEC_URL", "-")]
96 [Property("CRITERIA", "MR")]
97 [Property("AUTHOR", "guowei.wang@samsung.com")]
98 public void LayoutControllerRequestLayoutParentNotNUll()
100 tlog.Debug(tag, $"LayoutControllerRequestLayoutParentNotNUll START");
102 var testingTarget = new LayoutController(Window.Instance);
103 Assert.IsNotNull(testingTarget, "Can't create success object LayoutController");
104 Assert.IsInstanceOf<LayoutController>(testingTarget, "Should be an instance of LayoutController type.");
106 using (LayoutGroup group = new LayoutGroup())
108 using (LayoutItem layoutItem = new LayoutItem())
110 group.Add(layoutItem);
113 testingTarget.RequestLayout(layoutItem);
117 tlog.Debug(tag, e.Message.ToString());
118 Assert.Fail("Caught Exception : Failed!");
123 testingTarget.Dispose();
124 tlog.Debug(tag, $"LayoutControllerRequestLayoutParentNotNUll END (OK)");
129 [Description("LayoutController GetCoreAnimation.")]
130 [Property("SPEC", "Tizen.NUI.LayoutController.GetCoreAnimation M")]
131 [Property("SPEC_URL", "-")]
132 [Property("CRITERIA", "MR")]
133 [Property("AUTHOR", "guowei.wang@samsung.com")]
134 public void LayoutControllerGetCoreAnimation()
136 tlog.Debug(tag, $"LayoutControllerGetCoreAnimation START");
138 var testingTarget = new LayoutController(Window.Instance);
139 Assert.IsNotNull(testingTarget, "Can't create success object LayoutController");
140 Assert.IsInstanceOf<LayoutController>(testingTarget, "Should be an instance of LayoutController type.");
142 var result = testingTarget.GetCoreAnimation();
143 tlog.Debug(tag, "Get core animation : " + result);
145 testingTarget.Dispose();
146 tlog.Debug(tag, $"LayoutControllerGetCoreAnimation END (OK)");