[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 / Transition / TSTransitionSetSignal.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/Transition/TransitionSetSignal")]
13     public class InternalTransitionSetSignalTest
14     {
15         private const string tag = "NUITEST";
16         private global::System.IntPtr OnIntPtrCallback;
17         private delegate bool dummyCallback(IntPtr transitionSet);
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("TransitionSetSignal constructor.")]
38         [Property("SPEC", "Tizen.NUI.TransitionSetSignal.TransitionSetSignal M")]
39         [Property("SPEC_URL", "-")]
40         [Property("CRITERIA", "MR")]
41         [Property("AUTHOR", "guowei.wang@samsung.com")]
42         public void TransitionSetSignalConstructor()
43         {
44             tlog.Debug(tag, $"TransitionSetSignalConstructor START");
45
46             using (View view = new View())
47             {
48                 var testingTarget = new TransitionSetFinishedSignal(view.SwigCPtr.Handle, false);
49                 Assert.IsNotNull(testingTarget, "Should be not null!");
50                 Assert.IsInstanceOf<TransitionSetFinishedSignal>(testingTarget, "Should be an Instance of TransitionSetFinishedSignal!");
51
52                 testingTarget.Dispose();
53             }
54
55             tlog.Debug(tag, $"TransitionSetSignalConstructor END (OK)");
56         }
57
58         [Test]
59         [Category("P1")]
60         [Description("TransitionSetSignal Empty.")]
61         [Property("SPEC", "Tizen.NUI.TransitionSetSignal.Empty M")]
62         [Property("SPEC_URL", "-")]
63         [Property("CRITERIA", "MR")]
64         [Property("AUTHOR", "guowei.wang@samsung.com")]
65         public void TransitionSetSignalEmpty()
66         {
67             tlog.Debug(tag, $"TransitionSetSignalEmpty START");
68
69             using (View view = new View())
70             {
71                 var testingTarget = new TransitionSetFinishedSignal(view.SwigCPtr.Handle, false);
72                 Assert.IsNotNull(testingTarget, "Should be not null!");
73                 Assert.IsInstanceOf<TransitionSetFinishedSignal>(testingTarget, "Should be an Instance of TransitionSetFinishedSignal!");
74
75                 try
76                 {
77                     tlog.Debug(tag, "Empty : " + testingTarget.Empty());
78                 }
79                 catch (Exception e)
80                 {
81                     tlog.Debug(tag, e.Message.ToString());
82                     Assert.Fail("Caught Exception : Failed!");
83                 }
84
85                 testingTarget.Dispose();
86             }
87
88             tlog.Debug(tag, $"TransitionSetSignalEmpty END (OK)");
89         }
90
91         [Test]
92         [Category("P1")]
93         [Description("TransitionSetSignal GetConnectionCount.")]
94         [Property("SPEC", "Tizen.NUI.TransitionSetSignal.GetConnectionCount M")]
95         [Property("SPEC_URL", "-")]
96         [Property("CRITERIA", "MR")]
97         [Property("AUTHOR", "guowei.wang@samsung.com")]
98         public void TransitionSetSignalGetConnectionCount()
99         {
100             tlog.Debug(tag, $"TransitionSetSignalGetConnectionCount START");
101
102             using (View view = new View())
103             {
104                 var testingTarget = new TransitionSetFinishedSignal(view.SwigCPtr.Handle, false);
105                 Assert.IsNotNull(testingTarget, "Should be not null!");
106                 Assert.IsInstanceOf<TransitionSetFinishedSignal>(testingTarget, "Should be an Instance of TransitionSetFinishedSignal!");
107
108                 try
109                 {
110                     tlog.Debug(tag, "ConnectionCount : " + testingTarget.GetConnectionCount());
111                 }
112                 catch (Exception e)
113                 {
114                     tlog.Debug(tag, e.Message.ToString());
115                     Assert.Fail("Caught Exception : Failed!");
116                 }
117
118                 testingTarget.Dispose();
119             }
120
121             tlog.Debug(tag, $"TransitionSetSignalGetConnectionCount END (OK)");
122         }
123
124         //[Test]
125         //[Category("P1")]
126         //[Description("TransitionSetSignal Connect.")]
127         //[Property("SPEC", "Tizen.NUI.TransitionSetSignal.Connect M")]
128         //[Property("SPEC_URL", "-")]
129         //[Property("CRITERIA", "MR")]
130         //[Property("AUTHOR", "guowei.wang@samsung.com")]
131         //public void TransitionSetSignalConnect()
132         //{
133         //    tlog.Debug(tag, $"TransitionSetSignalConnect START");
134
135         //    using (View view = new View())
136         //    {
137         //        var testingTarget = new TransitionSetFinishedSignal(view.SwigCPtr.Handle, false);
138         //        Assert.IsNotNull(testingTarget, "Should be not null!");
139         //        Assert.IsInstanceOf<TransitionSetFinishedSignal>(testingTarget, "Should be an Instance of TransitionSetFinishedSignal!");
140
141         //        try
142         //        {
143         //            dummyCallback callback = OnDummyCallback;
144         //            testingTarget.Connect(callback);
145         //            testingTarget.Disconnect(callback);
146         //        }
147         //        catch (Exception e)
148         //        {
149         //            tlog.Debug(tag, e.Message.ToString());
150         //            Assert.Fail("Caught Exception: Failed!");
151         //        }
152
153         //        testingTarget.Dispose();
154         //    }
155
156         //    tlog.Debug(tag, $"TransitionSetSignalConnect END (OK)");
157         //}
158
159         //[Test]
160         //[Category("P1")]
161         //[Description("TransitionSetSignal Connect. With IntPtr")]
162         //[Property("SPEC", "Tizen.NUI.TransitionSetSignal.Connect M")]
163         //[Property("SPEC_URL", "-")]
164         //[Property("CRITERIA", "MR")]
165         //[Property("AUTHOR", "guowei.wang@samsung.com")]
166         //public void TransitionSetSignalConnectWithIntPtr()
167         //{
168         //    tlog.Debug(tag, $"TransitionSetSignalConnectWithIntPtr START");
169
170         //    using (View view = new View())
171         //    {
172         //        var testingTarget = new TransitionSetFinishedSignal(view.SwigCPtr.Handle, false);
173         //        Assert.IsNotNull(testingTarget, "Should be not null!");
174         //        Assert.IsInstanceOf<TransitionSetFinishedSignal>(testingTarget, "Should be an Instance of TransitionSetFinishedSignal!");
175
176         //        try
177         //        {
178         //            testingTarget.Connect(view.SwigCPtr.Handle);
179         //            testingTarget.Disconnect(view.SwigCPtr.Handle);
180         //        }
181         //        catch (Exception e)
182         //        {
183         //            tlog.Debug(tag, e.Message.ToString());
184         //            Assert.Fail("Caught Exception: Failed!");
185         //        }
186
187         //        testingTarget.Dispose();
188         //    }
189
190         //    tlog.Debug(tag, $"TransitionSetSignalConnectWithIntPtr END (OK)");
191         //}
192     }
193 }