[NUI] Update NUI.Devel to fix block and crash issues.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Common / TSStringToVoidSignal.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6
7 namespace Tizen.NUI.Devel.Tests
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("internal/Common/StringToVoidSignal")]
13     public class InternalStringToVoidSignalTest
14     {
15         private const string tag = "NUITEST";
16
17         private delegate bool dummyCallback(IntPtr signal);
18         private bool OnDummyCallback(IntPtr data)
19         {
20             return false;
21         }
22
23         [SetUp]
24         public void Init()
25         {
26             tlog.Info(tag, "Init() is called!");
27         }
28
29         [TearDown]
30         public void Destroy()
31         {
32             tlog.Info(tag, "Destroy() is called!");
33         }
34
35         [Test]
36         [Category("P1")]
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()
43         {
44             tlog.Debug(tag, $"StringToVoidSignalConstructor START");
45
46             var testingTarget = new StringToVoidSignal();
47             Assert.IsNotNull(testingTarget, "Should be not null!");
48             Assert.IsInstanceOf<StringToVoidSignal>(testingTarget, "Should be an Instance of StringToVoidSignal!");
49
50             testingTarget.Dispose();
51             tlog.Debug(tag, $"StringToVoidSignalConstructor END (OK)");
52         }
53
54         [Test]
55         [Category("P1")]
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()
62         {
63             tlog.Debug(tag, $"StringToVoidSignalEmpty START");
64             
65             using (TextLabel label = new TextLabel())
66             {
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!");
71
72                 try
73                 {
74                     testingTarget.Empty();
75                 }
76                 catch (Exception e)
77                 {
78                     tlog.Debug(tag, e.Message.ToString());
79                     Assert.Fail("Caught Exception: Failed!");
80                 }
81
82                 testingTarget.Dispose();
83             }
84
85             tlog.Debug(tag, $"StringToVoidSignalEmpty END (OK)");
86         }
87
88         [Test]
89         [Category("P1")]
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()
96         {
97             tlog.Debug(tag, $"StringToVoidSignalGetConnectionCount START");
98
99             using (TextLabel label = new TextLabel())
100             {
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!");
105
106                 try
107                 {
108                     testingTarget.GetConnectionCount();
109                 }
110                 catch (Exception e)
111                 {
112                     tlog.Debug(tag, e.Message.ToString());
113                     Assert.Fail("Caught Exception: Failed!");
114                 }
115
116                 testingTarget.Dispose();
117             }
118
119             tlog.Debug(tag, $"StringToVoidSignalGetConnectionCount END (OK)");
120         }
121
122         [Test]
123         [Category("P1")]
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()
130         {
131             tlog.Debug(tag, $"StringToVoidSignalGetResult START");
132
133             using (TextLabel label = new TextLabel())
134             {
135                 label.Text = "TextLabel";
136                 try
137                 {
138                     var result = StringToVoidSignal.GetResult(label.SwigCPtr.Handle);
139                     tlog.Debug(tag, "GetResult : " + result);
140                 }
141                 catch (Exception e)
142                 {
143                     tlog.Debug(tag, e.Message.ToString());
144                     Assert.Fail("Cuaght Exception: Failed!");
145                 }
146             }
147
148             tlog.Debug(tag, $"StringToVoidSignalGetResult END (OK)");
149         }
150
151         [Test]
152         [Category("P1")]
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()
159         {
160             tlog.Debug(tag, $"StringToVoidSignalSetResult START");
161
162             using (TextLabel label = new TextLabel())
163             {
164                 label.Text = "";
165                 try
166                 {
167                     StringToVoidSignal.SetResult(label.SwigCPtr.Handle, "TextLabel");
168                     tlog.Debug(tag, "GetResult : " + StringToVoidSignal.GetResult(label.SwigCPtr.Handle));
169                 }
170                 catch (Exception e)
171                 {
172                     tlog.Debug(tag, e.Message.ToString());
173                     Assert.Fail("Cuaght Exception: Failed!");
174                 }
175             }
176
177             tlog.Debug(tag, $"StringToVoidSignalSetResult END (OK)");
178         }
179     }
180 }