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("internal/Widget/WidgetViewSignal")]
14 public class WidgetViewSignalTests
16 private const string tag = "NUITEST";
17 private delegate void SignalCallback();
19 private static void MyDelegate()
21 Log.Fatal("TCT", "[TestCase][AddIdle][NUIApplication] Pass");
27 Tizen.Log.Info(tag, "Init() is called!");
33 Tizen.Log.Info(tag, "Destroy() is called!");
38 [Description("WidgetViewSignal constructor.")]
39 [Property("SPEC", "Tizen.NUI.WidgetViewSignal.WidgetViewSignal C")]
40 [Property("SPEC_URL", "-")]
41 [Property("CRITERIA", "CONSTR")]
42 [Property("AUTHOR", "guowei.wang@samsung.com")]
43 public void WidgetViewSignalConstructor()
45 tlog.Debug(tag, $"WidgetViewSignalConstructor START");
47 var testingTarget = new WidgetViewSignal() ;
48 Assert.IsNotNull(testingTarget, "Should be not null!");
49 Assert.IsInstanceOf<WidgetViewSignal>(testingTarget, "Should be an Instance of WidgetViewSignal!");
51 testingTarget.Dispose();
52 tlog.Debug(tag, $"WidgetViewSignalConstructor END (OK)");
57 [Description("WidgetViewSignal Dispose.")]
58 [Property("SPEC", "Tizen.NUI.WidgetViewSignal.Dispose M")]
59 [Property("SPEC_URL", "-")]
60 [Property("CRITERIA", "MR MCST")]
61 [Property("AUTHOR", "guowei.wang@samsung.com")]
62 public void WidgetViewSignalDispose()
64 tlog.Debug(tag, $"WidgetViewSignalDispose START");
66 var testingTarget = new WidgetViewSignal();
67 Assert.IsNotNull(testingTarget, "Should be not null!");
68 Assert.IsInstanceOf<WidgetViewSignal>(testingTarget, "Should be an Instance of WidgetViewSignal!");
72 testingTarget.Dispose();
76 Assert.Fail("Caught Exception" + e.ToString());
79 testingTarget.Dispose();
80 tlog.Debug(tag, $"WidgetViewSignalDispose END (OK)");
85 [Description("WidgetViewSignal Empty.")]
86 [Property("SPEC", "Tizen.NUI.WidgetViewSignal.Empty M")]
87 [Property("SPEC_URL", "-")]
88 [Property("CRITERIA", "MR")]
89 [Property("AUTHOR", "guowei.wang@samsung.com")]
90 public void WidgetViewSignalEmpty()
92 tlog.Debug(tag, $"WidgetViewSignalEmpty START");
94 var testingTarget = new WidgetViewSignal();
95 Assert.IsNotNull(testingTarget, "Should be not null!");
96 Assert.IsInstanceOf<WidgetViewSignal>(testingTarget, "Should be an Instance of WidgetViewSignal!");
98 Assert.IsTrue(testingTarget.Empty(), "Should be true here!");
100 testingTarget.Dispose();
101 tlog.Debug(tag, $"WidgetViewSignalEmpty END (OK)");
106 [Description("WidgetViewSignal GetConnectionCount.")]
107 [Property("SPEC", "Tizen.NUI.WidgetViewSignal.GetConnectionCount M")]
108 [Property("SPEC_URL", "-")]
109 [Property("CRITERIA", "MR")]
110 [Property("AUTHOR", "guowei.wang@samsung.com")]
111 public void WidgetViewSignalGetConnectionCount()
113 tlog.Debug(tag, $"WidgetViewSignalGetConnectionCount START");
115 var testingTarget = new WidgetViewSignal();
116 Assert.IsNotNull(testingTarget, "Should be not null!");
117 Assert.IsInstanceOf<WidgetViewSignal>(testingTarget, "Should be an Instance of WidgetViewSignal!");
119 Assert.AreEqual(0, testingTarget.GetConnectionCount(), "Should be zero here!");
121 testingTarget.Dispose();
122 tlog.Debug(tag, $"WidgetViewSignalGetConnectionCount END (OK)");
127 [Description("WidgetViewSignal Connect.")]
128 [Property("SPEC", "Tizen.NUI.WidgetViewSignal.Connect M")]
129 [Property("SPEC_URL", "-")]
130 [Property("CRITERIA", "MR")]
131 [Property("AUTHOR", "guowei.wang@samsung.com")]
132 public void WidgetViewSignalConnect()
134 tlog.Debug(tag, $"WidgetViewSignalConnect START");
136 var testingTarget = new WidgetViewSignal();
137 Assert.IsNotNull(testingTarget, "Should be not null!");
138 Assert.IsInstanceOf<WidgetViewSignal>(testingTarget, "Should be an Instance of WidgetViewSignal!");
142 SignalCallback signalCallback = new SignalCallback(MyDelegate);
143 testingTarget.Connect(signalCallback);
144 Assert.AreEqual(1, testingTarget.GetConnectionCount(), "Should be one here!");
148 Assert.Fail("Caught Exception" + e.ToString());
151 testingTarget.Dispose();
152 tlog.Debug(tag, $"WidgetViewSignalConnect END (OK)");
157 [Description("WidgetViewSignal Connect. With null.")]
158 [Property("SPEC", "Tizen.NUI.WidgetViewSignal.Connect M")]
159 [Property("SPEC_URL", "-")]
160 [Property("CRITERIA", "MR")]
161 [Property("AUTHOR", "guowei.wang@samsung.com")]
162 public void WidgetViewSignalConnectWithNull()
164 tlog.Debug(tag, $"WidgetViewSignalConnectWithNull START");
166 var testingTarget = new WidgetViewSignal();
167 Assert.IsNotNull(testingTarget, "Should be not null!");
168 Assert.IsInstanceOf<WidgetViewSignal>(testingTarget, "Should be an Instance of WidgetViewSignal!");
172 testingTarget.Connect(null);
173 Assert.Fail("Should throw the ArgumentNullException!");
175 catch (ArgumentNullException e)
180 testingTarget.Dispose();
181 tlog.Debug(tag, $"WidgetViewSignalConnectWithNull END (OK)");
186 [Description("WidgetViewSignal Disconnect")]
187 [Property("SPEC", "Tizen.NUI.WidgetViewSignal.Disconnect M")]
188 [Property("SPEC_URL", "-")]
189 [Property("CRITERIA", "MR")]
190 [Property("AUTHOR", "guowei.wang@samsung.com")]
191 public void WidgetViewSignalDisconnect()
193 tlog.Debug(tag, $"WidgetViewSignalDisconnect START");
195 var testingTarget = new WidgetViewSignal();
196 Assert.IsNotNull(testingTarget, "Should be not null!");
197 Assert.IsInstanceOf<WidgetViewSignal>(testingTarget, "Should be an Instance of WidgetViewSignal!");
199 SignalCallback signalCallback = new SignalCallback(MyDelegate);
203 testingTarget.Connect(signalCallback);
204 Assert.AreEqual(1, testingTarget.GetConnectionCount(), "Should be one here!");
206 testingTarget.Disconnect(signalCallback);
207 Assert.AreEqual(0, testingTarget.GetConnectionCount(), "Should be zero here!");
211 Assert.Fail("Caught Exception" + e.ToString());
214 testingTarget.Dispose();
215 tlog.Debug(tag, $"WidgetViewSignalDisconnect END (OK)");
220 [Description("WidgetViewSignal Disconnect. With null.")]
221 [Property("SPEC", "Tizen.NUI.WidgetViewSignal.Disconnect M")]
222 [Property("SPEC_URL", "-")]
223 [Property("CRITERIA", "MR")]
224 [Property("AUTHOR", "guowei.wang@samsung.com")]
225 public void WidgetViewSignalDisconnectWithNull()
227 tlog.Debug(tag, $"WidgetViewSignalDisconnect START");
229 var testingTarget = new WidgetViewSignal();
230 Assert.IsNotNull(testingTarget, "Should be not null!");
231 Assert.IsInstanceOf<WidgetViewSignal>(testingTarget, "Should be an Instance of WidgetViewSignal!");
235 testingTarget.Disconnect(null);
236 Assert.Fail("Should throw the ArgumentNullException!");
238 catch (ArgumentNullException e)
243 testingTarget.Dispose();
244 tlog.Debug(tag, $"WidgetViewSignalDisconnect END (OK)");
249 [Description("WidgetViewSignal Emit. With null.")]
250 [Property("SPEC", "Tizen.NUI.WidgetViewSignal.Emit M")]
251 [Property("SPEC_URL", "-")]
252 [Property("CRITERIA", "MR")]
253 [Property("AUTHOR", "guowei.wang@samsung.com")]
254 public void WidgetViewSignalEmitWithNull()
256 tlog.Debug(tag, $"WidgetViewSignalEmitWithNull START");
258 var testingTarget = new WidgetViewSignal();
259 Assert.IsNotNull(testingTarget, "Should be not null!");
260 Assert.IsInstanceOf<WidgetViewSignal>(testingTarget, "Should be an Instance of WidgetViewSignal!");
264 testingTarget.Emit(null);
265 Assert.Fail("Should throw the ArgumentNullException!");
267 catch (ArgumentNullException e)
272 testingTarget.Dispose();
273 tlog.Debug(tag, $"WidgetViewSignalEmitWithNull END (OK)");