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/Common/StringToVoidSignal")]
13 public class InternalStringToVoidSignalTest
15 private const string tag = "NUITEST";
17 private delegate bool dummyCallback(IntPtr signal);
18 private bool OnDummyCallback(IntPtr data)
26 tlog.Info(tag, "Init() is called!");
32 tlog.Info(tag, "Destroy() is called!");
37 [Description("StringToVoidSignal constructor.")]
38 [Property("SPEC", "Tizen.NUI.StringToVoidSignal.StringToVoidSignal C")]
39 [Property("SPEC_URL", "-")]
40 [Property("CRITERIA", "CONSTR")]
41 [Property("AUTHOR", "guowei.wang@samsung.com")]
42 public void StringToVoidSignalConstructor()
44 tlog.Debug(tag, $"StringToVoidSignalConstructor START");
46 var testingTarget = new StringToVoidSignal();
47 Assert.IsNotNull(testingTarget, "Should be not null!");
48 Assert.IsInstanceOf<StringToVoidSignal>(testingTarget, "Should be an Instance of StringToVoidSignal!");
50 testingTarget.Dispose();
51 tlog.Debug(tag, $"StringToVoidSignalConstructor END (OK)");
56 [Description("StringToVoidSignal Empty.")]
57 [Property("SPEC", "Tizen.NUI.StringToVoidSignal.Empty M")]
58 [Property("SPEC_URL", "-")]
59 [Property("CRITERIA", "MR")]
60 [Property("AUTHOR", "guowei.wang@samsung.com")]
61 public void StringToVoidSignalEmpty()
63 tlog.Debug(tag, $"StringToVoidSignalEmpty START");
65 using (TextLabel label = new TextLabel())
67 label.Text = "TextLabel";
68 var testingTarget = new StringToVoidSignal(label.SwigCPtr.Handle, false);
69 Assert.IsNotNull(testingTarget, "Should be not null!");
70 Assert.IsInstanceOf<StringToVoidSignal>(testingTarget, "Should be an Instance of StringToVoidSignal!");
74 testingTarget.Empty();
78 tlog.Debug(tag, e.Message.ToString());
79 Assert.Fail("Caught Exception: Failed!");
82 testingTarget.Dispose();
85 tlog.Debug(tag, $"StringToVoidSignalEmpty END (OK)");
90 [Description("StringToVoidSignal GetConnectionCount.")]
91 [Property("SPEC", "Tizen.NUI.StringToVoidSignal.GetConnectionCount M")]
92 [Property("SPEC_URL", "-")]
93 [Property("CRITERIA", "MR")]
94 [Property("AUTHOR", "guowei.wang@samsung.com")]
95 public void StringToVoidSignalGetConnectionCount()
97 tlog.Debug(tag, $"StringToVoidSignalGetConnectionCount START");
99 using (TextLabel label = new TextLabel())
101 label.Text = "TextLabel";
102 var testingTarget = new StringToVoidSignal(label.SwigCPtr.Handle, false);
103 Assert.IsNotNull(testingTarget, "Should be not null!");
104 Assert.IsInstanceOf<StringToVoidSignal>(testingTarget, "Should be an Instance of StringToVoidSignal!");
108 testingTarget.GetConnectionCount();
112 tlog.Debug(tag, e.Message.ToString());
113 Assert.Fail("Caught Exception: Failed!");
116 testingTarget.Dispose();
119 tlog.Debug(tag, $"StringToVoidSignalGetConnectionCount END (OK)");
124 [Description("StringToVoidSignal GetResult.")]
125 [Property("SPEC", "Tizen.NUI.StringToVoidSignal.GetResult M")]
126 [Property("SPEC_URL", "-")]
127 [Property("CRITERIA", "MR")]
128 [Property("AUTHOR", "guowei.wang@samsung.com")]
129 public void StringToVoidSignalGetResult()
131 tlog.Debug(tag, $"StringToVoidSignalGetResult START");
133 using (TextLabel label = new TextLabel())
135 label.Text = "TextLabel";
138 var result = StringToVoidSignal.GetResult(label.SwigCPtr.Handle);
139 tlog.Debug(tag, "GetResult : " + result);
143 tlog.Debug(tag, e.Message.ToString());
144 Assert.Fail("Cuaght Exception: Failed!");
148 tlog.Debug(tag, $"StringToVoidSignalGetResult END (OK)");
153 [Description("StringToVoidSignal SetResult.")]
154 [Property("SPEC", "Tizen.NUI.StringToVoidSignal.SetResult M")]
155 [Property("SPEC_URL", "-")]
156 [Property("CRITERIA", "MR")]
157 [Property("AUTHOR", "guowei.wang@samsung.com")]
158 public void StringToVoidSignalSetResult()
160 tlog.Debug(tag, $"StringToVoidSignalSetResult START");
162 using (TextLabel label = new TextLabel())
167 StringToVoidSignal.SetResult(label.SwigCPtr.Handle, "TextLabel");
168 tlog.Debug(tag, "GetResult : " + StringToVoidSignal.GetResult(label.SwigCPtr.Handle));
172 tlog.Debug(tag, e.Message.ToString());
173 Assert.Fail("Cuaght Exception: Failed!");
177 tlog.Debug(tag, $"StringToVoidSignalSetResult END (OK)");