3 using NUnit.Framework.TUnit;
5 using Tizen.NUI.Components;
6 using Tizen.NUI.BaseComponents;
8 namespace Tizen.NUI.Components.Devel.Tests
10 using tlog = Tizen.Log;
13 [Description("Controls/TabContent")]
14 public class TabContentTest
16 private const string tag = "NUITEST";
18 internal class MyTabContent : TabContent
20 public MyTabContent() : base()
23 public void OnDispose(DisposeTypes types)
28 public void OnAddView(View view)
33 public void OnRemoveView(View view)
35 base.RemoveView(view);
42 tlog.Info(tag, "Init() is called!");
48 tlog.Info(tag, "Destroy() is called!");
53 [Description("TabContent Dispose.")]
54 [Property("SPEC", "Tizen.NUI.Components.TabContent.Dispose M")]
55 [Property("SPEC_URL", "-")]
56 [Property("CRITERIA", "MR")]
57 [Property("COVPARAM", "")]
58 [Property("AUTHOR", "guowei.wang@samsung.com")]
59 public void TabContentDispose()
61 tlog.Debug(tag, $"TabContentDispose START");
63 var testingTarget = new MyTabContent();
64 Assert.IsNotNull(testingTarget, "null handle");
65 Assert.IsInstanceOf<TabContent>(testingTarget, "Should return TabContent instance.");
69 testingTarget.OnDispose(DisposeTypes.Explicit);
73 tlog.Debug(tag, e.Message.ToString());
74 Assert.Fail("Caught Exception : Failed!");
77 testingTarget.Dispose();
78 tlog.Debug(tag, $"TabContentDispose END (OK)");
83 [Description("TabContent RemoveView.")]
84 [Property("SPEC", "Tizen.NUI.Components.TabContent.RemoveView M")]
85 [Property("SPEC_URL", "-")]
86 [Property("CRITERIA", "MR")]
87 [Property("COVPARAM", "")]
88 [Property("AUTHOR", "guowei.wang@samsung.com")]
89 public void TabContentRemoveView()
91 tlog.Debug(tag, $"TabContentRemoveView START");
93 var testingTarget = new MyTabContent()
95 Size = new Size(100, 100),
97 Assert.IsNotNull(testingTarget, "null handle");
98 Assert.IsInstanceOf<TabContent>(testingTarget, "Should return TabContent instance.");
100 View dummy1 = new View()
102 Size = new Size(50, 100),
103 Position = new Position(0, 0),
106 View dummy2 = new View()
108 Size = new Size(50, 100),
109 Position = new Position(50, 0),
112 testingTarget.OnAddView(dummy1);
113 testingTarget.OnAddView(dummy2);
117 testingTarget.OnRemoveView(dummy1);
121 tlog.Debug(tag, e.Message.ToString());
122 Assert.Fail("Caught Exception : Failed!");
127 testingTarget.OnDispose(DisposeTypes.Explicit);
128 tlog.Debug(tag, $"TabContentRemoveView END (OK)");
133 [Description("TabContent AddView.")]
134 [Property("SPEC", "Tizen.NUI.Components.TabContent.AddView M")]
135 [Property("SPEC_URL", "-")]
136 [Property("CRITERIA", "MR")]
137 [Property("COVPARAM", "")]
138 [Property("AUTHOR", "guowei.wang@samsung.com")]
139 public void TabContentAddView()
141 tlog.Debug(tag, $"TabContentAddView START");
143 var testingTarget = new MyTabContent();
144 Assert.IsNotNull(testingTarget, "null handle");
145 Assert.IsInstanceOf<TabContent>(testingTarget, "Should return TabContent instance.");
151 testingTarget.OnAddView(view);
153 catch (ArgumentNullException)
155 testingTarget.Dispose();
156 tlog.Debug(tag, $"TabContentAddView END (OK)");
157 Assert.Pass("Caught ArgumentNullException : Passed!");
164 [Description("TabContent RemoveView.")]
165 [Property("SPEC", "Tizen.NUI.Components.TabContent.RemoveView M")]
166 [Property("SPEC_URL", "-")]
167 [Property("CRITERIA", "MR")]
168 [Property("COVPARAM", "")]
169 [Property("AUTHOR", "guowei.wang@samsung.com")]
170 public void TabContentRemoveViewWithNull()
172 tlog.Debug(tag, $"TabContentRemoveViewWithNull START");
174 var testingTarget = new MyTabContent();
175 Assert.IsNotNull(testingTarget, "null handle");
176 Assert.IsInstanceOf<TabContent>(testingTarget, "Should return TabContent instance.");
182 testingTarget.OnRemoveView(view);
184 catch (ArgumentNullException)
186 testingTarget.Dispose();
187 tlog.Debug(tag, $"TabContentRemoveViewWithNull END (OK)");
188 Assert.Pass("Caught ArgumentNullException : Passed!");