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/CheckBoxGroup")]
14 public class CheckBoxGroupTest
16 private const string tag = "NUITEST";
17 private string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
22 tlog.Info(tag, "Init() is called!");
28 tlog.Info(tag, "Destroy() is called!");
33 [Description("CheckBoxGroup contructor.")]
34 [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.CheckBoxGroup C")]
35 [Property("SPEC_URL", "-")]
36 [Property("CRITERIA", "CONSTR")]
37 [Property("COVPARAM", "")]
38 [Property("AUTHOR", "guowei.wang@samsung.com")]
39 public void CheckBoxGroupContructor()
41 tlog.Debug(tag, $"CheckBoxGroupContructor START");
43 var testingTarget = new CheckBoxGroup();
44 Assert.IsNotNull(testingTarget, "null handle");
45 Assert.IsInstanceOf<CheckBoxGroup>(testingTarget, "Should return CheckBoxGroup instance.");
47 tlog.Debug(tag, $"CheckBoxGroupContructor END (OK)");
52 [Description("CheckBoxGroup SetIsGroupHolder.")]
53 [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.SetIsGroupHolder M")]
54 [Property("SPEC_URL", "-")]
55 [Property("CRITERIA", "CONSTR")]
56 [Property("COVPARAM", "")]
57 [Property("AUTHOR", "guowei.wang@samsung.com")]
58 public void CheckBoxGroupSetIsGroupHolder()
60 tlog.Debug(tag, $"CheckBoxSetIsGroupHolder START");
62 View view = new View()
64 Size = new Size(100, 200),
65 BackgroundColor = Color.Green,
68 CheckBoxGroup.SetIsGroupHolder(view, true);
69 tlog.Debug(tag, "GetIsGroupHolder : " + CheckBoxGroup.GetIsGroupHolder(view));
71 tlog.Debug(tag, "GetCheckBoxGroup : " + CheckBoxGroup.GetCheckBoxGroup(view));
74 tlog.Debug(tag, $"CheckBoxSetIsGroupHolder END (OK)");
79 [Description("CheckBoxGroup Add.")]
80 [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.Add M")]
81 [Property("SPEC_URL", "-")]
82 [Property("CRITERIA", "MR")]
83 [Property("COVPARAM", "")]
84 [Property("AUTHOR", "guowei.wang@samsung.com")]
85 public void CheckBoxGroupAdd()
87 tlog.Debug(tag, $"CheckBoxGroupAdd START");
89 var testingTarget = new CheckBoxGroup();
90 Assert.IsNotNull(testingTarget, "null handle");
91 Assert.IsInstanceOf<CheckBoxGroup>(testingTarget, "Should return CheckBoxGroup instance.");
93 CheckBox cb = new CheckBox()
95 Size = new Size(48, 48)
100 testingTarget.Add(cb);
101 tlog.Debug(tag, "GetItem : " + testingTarget.GetItem(0));
103 testingTarget.Remove(cb);
107 tlog.Debug(tag, e.Message.ToString());
108 Assert.Fail("Caught Exception : Failed!");
111 tlog.Debug(tag, $"CheckBoxGroupAdd END (OK)");
116 [Description("CheckBoxGroup CheckAll.")]
117 [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.CheckAll M")]
118 [Property("SPEC_URL", "-")]
119 [Property("CRITERIA", "MR")]
120 [Property("COVPARAM", "")]
121 [Property("AUTHOR", "guowei.wang@samsung.com")]
122 public void CheckBoxGroupCheckAll()
124 tlog.Debug(tag, $"CheckBoxGroupCheckAll START");
126 var testingTarget = new CheckBoxGroup();
127 Assert.IsNotNull(testingTarget, "null handle");
128 Assert.IsInstanceOf<CheckBoxGroup>(testingTarget, "Should return CheckBoxGroup instance.");
130 CheckBox cb1 = new CheckBox()
132 Size = new Size(48, 48),
138 CheckBox cb2 = new CheckBox()
140 Size = new Size(48, 48),
148 testingTarget.Add(cb1);
149 testingTarget.Add(cb2);
150 testingTarget.CheckAll(true);
152 var result = testingTarget.IsCheckedAll();
153 tlog.Debug(tag, "IsCheckedAll : " + result);
155 tlog.Debug(tag, "GetCheckedItems : " + testingTarget.GetCheckedItems());
156 tlog.Debug(tag, "GetCheckedIndices : " + testingTarget.GetCheckedIndices());
160 tlog.Debug(tag, e.Message.ToString());
161 Assert.Fail("Caught Exception : Failed!");
164 tlog.Debug(tag, $"CheckBoxGroupCheckAll END (OK)");