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();
52 tlog.Debug(tag, $"StringToVoidSignalConstructor END (OK)");
57 [Description("StringToVoidSignal Empty.")]
58 [Property("SPEC", "Tizen.NUI.StringToVoidSignal.Empty M")]
59 [Property("SPEC_URL", "-")]
60 [Property("CRITERIA", "MR")]
61 [Property("AUTHOR", "guowei.wang@samsung.com")]
62 public void StringToVoidSignalEmpty()
64 tlog.Debug(tag, $"StringToVoidSignalEmpty START");
66 using (TextLabel label = new TextLabel())
68 label.Text = "TextLabel";
69 var testingTarget = new StringToVoidSignal(label.SwigCPtr.Handle, false);
70 Assert.IsNotNull(testingTarget, "Should be not null!");
71 Assert.IsInstanceOf<StringToVoidSignal>(testingTarget, "Should be an Instance of StringToVoidSignal!");
75 testingTarget.Empty();
79 tlog.Debug(tag, e.Message.ToString());
80 Assert.Fail("Caught Exception: Failed!");
83 testingTarget.Dispose();
86 tlog.Debug(tag, $"StringToVoidSignalEmpty END (OK)");
91 [Description("StringToVoidSignal GetConnectionCount.")]
92 [Property("SPEC", "Tizen.NUI.StringToVoidSignal.GetConnectionCount M")]
93 [Property("SPEC_URL", "-")]
94 [Property("CRITERIA", "MR")]
95 [Property("AUTHOR", "guowei.wang@samsung.com")]
96 public void StringToVoidSignalGetConnectionCount()
98 tlog.Debug(tag, $"StringToVoidSignalGetConnectionCount START");
100 using (TextLabel label = new TextLabel())
102 label.Text = "TextLabel";
103 var testingTarget = new StringToVoidSignal(label.SwigCPtr.Handle, false);
104 Assert.IsNotNull(testingTarget, "Should be not null!");
105 Assert.IsInstanceOf<StringToVoidSignal>(testingTarget, "Should be an Instance of StringToVoidSignal!");
109 testingTarget.GetConnectionCount();
113 tlog.Debug(tag, e.Message.ToString());
114 Assert.Fail("Caught Exception: Failed!");
117 testingTarget.Dispose();
120 tlog.Debug(tag, $"StringToVoidSignalGetConnectionCount END (OK)");
125 [Description("StringToVoidSignal GetResult.")]
126 [Property("SPEC", "Tizen.NUI.StringToVoidSignal.GetResult M")]
127 [Property("SPEC_URL", "-")]
128 [Property("CRITERIA", "MR")]
129 [Property("AUTHOR", "guowei.wang@samsung.com")]
130 public void StringToVoidSignalGetResult()
132 tlog.Debug(tag, $"StringToVoidSignalGetResult START");
134 using (TextLabel label = new TextLabel())
136 label.Text = "TextLabel";
139 var result = StringToVoidSignal.GetResult(label.SwigCPtr.Handle);
140 tlog.Debug(tag, "GetResult : " + result);
144 tlog.Debug(tag, e.Message.ToString());
145 Assert.Fail("Cuaght Exception: Failed!");
149 tlog.Debug(tag, $"StringToVoidSignalGetResult END (OK)");
154 [Description("StringToVoidSignal SetResult.")]
155 [Property("SPEC", "Tizen.NUI.StringToVoidSignal.SetResult M")]
156 [Property("SPEC_URL", "-")]
157 [Property("CRITERIA", "MR")]
158 [Property("AUTHOR", "guowei.wang@samsung.com")]
159 public void StringToVoidSignalSetResult()
161 tlog.Debug(tag, $"StringToVoidSignalSetResult START");
163 using (TextLabel label = new TextLabel())
168 StringToVoidSignal.SetResult(label.SwigCPtr.Handle, "TextLabel");
169 tlog.Debug(tag, "GetResult : " + StringToVoidSignal.GetResult(label.SwigCPtr.Handle));
173 tlog.Debug(tag, e.Message.ToString());
174 Assert.Fail("Cuaght Exception: Failed!");
178 tlog.Debug(tag, $"StringToVoidSignalSetResult END (OK)");