[NUI] Update NUI.Devel to fix block and crash issues.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Events / TSTapGestureDetector.cs
1 using NUnit.Framework;
2 using NUnit.Framework.TUnit;
3 using System;
4 using Tizen.NUI;
5 using Tizen.NUI.BaseComponents;
6
7 namespace Tizen.NUI.Devel.Tests
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("public/Events/TapGestureDetector")]
13     class PublicTapGestureDetectorTest
14     {
15         private const string tag = "NUITEST";
16
17         [SetUp]
18         public void Init()
19         {
20             tlog.Info(tag, "Init() is called!");
21         }
22
23         [TearDown]
24         public void Destroy()
25         {
26             tlog.Info(tag, "Destroy() is called!");
27         }
28
29         [Test]
30         [Category("P1")]
31         [Description("TapGestureDetector constructor")]
32         [Property("SPEC", "Tizen.NUI.TapGestureDetector.TapGestureDetector C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("AUTHOR", "guowei.wang@samsung.com")]
36         public void TapGestureDetectorConstructor()
37         {
38             tlog.Debug(tag, $"TapGestureDetectorConstructor START");
39             
40             var testingTarget = new TapGestureDetector();
41             Assert.IsNotNull(testingTarget, "Can't create success object Hover");
42             Assert.IsInstanceOf<TapGestureDetector>(testingTarget, "Should be an instance of TapGestureDetector type.");
43
44             testingTarget.Dispose();
45             tlog.Debug(tag, $"TapGestureDetectorConstructor END (OK)");
46             Assert.Pass("TapGestureDetectorConstructor");
47         }
48
49         [Test]
50         [Category("P1")]
51         [Description("TapGestureDetector constructor")]
52         [Property("SPEC", "Tizen.NUI.TapGestureDetector.TapGestureDetector C")]
53         [Property("SPEC_URL", "-")]
54         [Property("CRITERIA", "CONSTR")]
55         [Property("AUTHOR", "guowei.wang@samsung.com")]
56         public void TapGestureDetectorConstructorWithTapsRequired()
57         {
58             tlog.Debug(tag, $"TapGestureDetectorConstructorWithTapsRequired START");
59
60             var testingTarget = new TapGestureDetector(4);
61             Assert.IsNotNull(testingTarget, "Can't create success object Hover");
62             Assert.IsInstanceOf<TapGestureDetector>(testingTarget, "Should be an instance of TapGestureDetector type.");
63
64             testingTarget.Dispose();
65             tlog.Debug(tag, $"TapGestureDetectorConstructorWithTapsRequired END (OK)");
66             Assert.Pass("TapGestureDetectorConstructor");
67         }
68
69         [Test]
70         [Category("P1")]
71         [Description("TapGestureDetector constructor")]
72         [Property("SPEC", "Tizen.NUI.TapGestureDetector.TapGestureDetector C")]
73         [Property("SPEC_URL", "-")]
74         [Property("CRITERIA", "CONSTR")]
75         [Property("AUTHOR", "guowei.wang@samsung.com")]
76         public void TapGestureDetectorConstructorWithTapGestureDetector()
77         {
78             tlog.Debug(tag, $"TapGestureDetectorConstructorWithTapGestureDetector START");
79
80             using (TapGestureDetector detector = new TapGestureDetector(4))
81             {
82                 var testingTarget = new TapGestureDetector(detector);
83                 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
84                 Assert.IsInstanceOf<TapGestureDetector>(testingTarget, "Should be an instance of TapGestureDetector type.");
85
86                 testingTarget.Dispose();
87             }
88
89             tlog.Debug(tag, $"TapGestureDetectorConstructorWithTapGestureDetector END (OK)");
90             Assert.Pass("TapGestureDetectorConstructor");
91         }
92
93         [Test]
94         [Category("P1")]
95         [Description("TapGestureDetector Assign")]
96         [Property("SPEC", "Tizen.NUI.TapGestureDetector.Assign M")]
97         [Property("SPEC_URL", "-")]
98         [Property("CRITERIA", "MR")]
99         [Property("AUTHOR", "guowei.wang@samsung.com")]
100         public void TapGestureDetectorAssign()
101         {
102             tlog.Debug(tag, $"TapGestureDetectorAssign START");
103
104             using (TapGestureDetector detector = new TapGestureDetector(4))
105             {
106                 var testingTarget = detector.Assign(detector);
107                 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
108                 Assert.IsInstanceOf<TapGestureDetector>(testingTarget, "Should be an instance of TapGestureDetector type.");
109
110                 testingTarget.Dispose();
111             }
112
113             tlog.Debug(tag, $"TapGestureDetectorAssign END (OK)");
114         }
115
116         [Test]
117         [Category("P1")]
118         [Description("TapGestureDetector SetMinimumTapsRequired")]
119         [Property("SPEC", "Tizen.NUI.TapGestureDetector.SetMinimumTapsRequired M")]
120         [Property("SPEC_URL", "-")]
121         [Property("CRITERIA", "MR")]
122         [Property("AUTHOR", "guowei.wang@samsung.com")]
123         public void TapGestureDetectorSetMinimumTapsRequired()
124         {
125             tlog.Debug(tag, $"TapGestureDetectorSetMinimumTapsRequired START");
126             TapGestureDetector a1 = new TapGestureDetector();
127             a1.SetMinimumTapsRequired(2);
128             a1.Dispose();
129             
130             tlog.Debug(tag, $"TapGestureDetectorSetMinimumTapsRequired END (OK)");
131             Assert.Pass("TapGestureDetectorSetMinimumTapsRequired");
132         }
133
134         [Test]
135         [Category("P1")]
136         [Description("TapGestureDetector SetMaximumTapsRequired")]
137         [Property("SPEC", "Tizen.NUI.TapGestureDetector.SetMaximumTapsRequired M")]
138         [Property("SPEC_URL", "-")]
139         [Property("CRITERIA", "MR")]
140         [Property("AUTHOR", "guowei.wang@samsung.com")]
141         public void TapGestureDetectorSetMaximumTapsRequired()
142         {
143             tlog.Debug(tag, $"TapGestureDetectorSetMaximumTapsRequired START");
144             TapGestureDetector a1 = new TapGestureDetector();
145             a1.SetMaximumTapsRequired(9);
146             a1.Dispose();
147             
148             tlog.Debug(tag, $"TapGestureDetectorSetMaximumTapsRequired END (OK)");
149             Assert.Pass("TapGestureDetectorSetMaximumTapsRequired");
150         }
151
152         [Test]
153         [Category("P1")]
154         [Description("TapGestureDetector GetMinimumTapsRequired")]
155         [Property("SPEC", "Tizen.NUI.TapGestureDetector.GetMinimumTapsRequired M")]
156         [Property("SPEC_URL", "-")]
157         [Property("CRITERIA", "MR")]
158         [Property("AUTHOR", "guowei.wang@samsung.com")]
159         public void TapGestureDetectorGetMinimumTapsRequired()
160         {
161             tlog.Debug(tag, $"TapGestureDetectorGetMinimumTapsRequired START");
162             TapGestureDetector a1 = new TapGestureDetector();
163             a1.SetMinimumTapsRequired(2);
164
165             a1.GetMinimumTapsRequired();
166             a1.Dispose();
167             
168             tlog.Debug(tag, $"TapGestureDetectorGetMinimumTapsRequired END (OK)");
169             Assert.Pass("TapGestureDetectorGetMinimumTapsRequired");
170         }
171
172         [Test]
173         [Category("P1")]
174         [Description("TapGestureDetector GetMaximumTapsRequired")]
175         [Property("SPEC", "Tizen.NUI.TapGestureDetector.GetMaximumTapsRequired M")]
176         [Property("SPEC_URL", "-")]
177         [Property("CRITERIA", "MR")]
178         [Property("AUTHOR", "guowei.wang@samsung.com")]
179         public void TapGestureDetectorGetMaximumTapsRequired()
180         {
181             tlog.Debug(tag, $"TapGestureDetectorGetMaximumTapsRequired START");
182             TapGestureDetector a1 = new TapGestureDetector();
183             a1.SetMaximumTapsRequired(9);
184
185             a1.GetMaximumTapsRequired();
186             a1.Dispose();
187             
188             tlog.Debug(tag, $"TapGestureDetectorGetMaximumTapsRequired END (OK)");
189             Assert.Pass("TapGestureDetectorGetMaximumTapsRequired");
190         }
191
192         [Test]
193         [Category("P1")]
194         [Description("TapGestureDetector DownCast")]
195         [Property("SPEC", "Tizen.NUI.TapGestureDetector.DownCast M")]
196         [Property("SPEC_URL", "-")]
197         [Property("CRITERIA", "MR")]
198         [Property("AUTHOR", "guowei.wang@samsung.com")]
199         public void TapGestureDetectorDownCast()
200         {
201             tlog.Debug(tag, $"TapGestureDetectorDownCast START");
202             BaseHandle handle = new BaseHandle();
203
204             TapGestureDetector a1 = TapGestureDetector.DownCast(handle);
205             
206             tlog.Debug(tag, $"TapGestureDetectorDownCast END (OK)");
207             Assert.Pass("TapGestureDetectorDownCast");
208         }
209
210         [Test]
211         [Category("P1")]
212         [Description("TapGestureDetector getCPtr")]
213         [Property("SPEC", "Tizen.NUI.TapGestureDetector.getCPtr M")]
214         [Property("SPEC_URL", "-")]
215         [Property("CRITERIA", "MR")]
216         [Property("AUTHOR", "guowei.wang@samsung.com")]
217         public void TapGestureDetectorgetCPtr()
218         {
219             tlog.Debug(tag, $"TapGestureDetectorgetCPtr START");
220             TapGestureDetector a1 = new TapGestureDetector();
221             global::System.Runtime.InteropServices.HandleRef p1 = TapGestureDetector.getCPtr(a1);
222             
223             tlog.Debug(tag, $"TapGestureDetectorgetCPtr END (OK)");
224             Assert.Pass("TapGestureDetectorgetCPtr");
225         }
226
227         [Test]
228         [Category("P1")]
229         [Description("TapGestureDetector GetTapGestureDetectorFromPtr")]
230         [Property("SPEC", "Tizen.NUI.TapGestureDetector.GetTapGestureDetectorFromPtr M")]
231         [Property("SPEC_URL", "-")]
232         [Property("CRITERIA", "MR")]
233         [Property("AUTHOR", "guowei.wang@samsung.com")]
234         public void TapGestureDetectorGetTapGestureDetectorFromPtr()
235         {
236             tlog.Debug(tag, $"TapGestureDetectorGetTapGestureDetectorFromPtr START");
237             TapGestureDetector a1 = new TapGestureDetector();
238                         
239             TapGestureDetector a2 = TapGestureDetector.GetTapGestureDetectorFromPtr(TapGestureDetector.getCPtr(a1).Handle);
240
241             a1.Dispose();
242             
243             tlog.Debug(tag, $"TapGestureDetectorGetTapGestureDetectorFromPtr END (OK)");
244             Assert.Pass("TapGestureDetectorGetTapGestureDetectorFromPtr");
245         }
246
247         [Test]
248         [Category("P1")]
249         [Description("TapGestureDetector DetectedSignal")]
250         [Property("SPEC", "Tizen.NUI.TapGestureDetector.DetectedSignal M")]
251         [Property("SPEC_URL", "-")]
252         [Property("CRITERIA", "MR")]
253         [Property("AUTHOR", "guowei.wang@samsung.com")]
254         public void TapGestureDetectorDetectedSignal()
255         {
256             tlog.Debug(tag, $"TapGestureDetectorDetectedSignal START");
257             TapGestureDetector a1 = new TapGestureDetector();
258             TapGestureDetectedSignal b1 = a1.DetectedSignal();
259          
260             tlog.Debug(tag, $"TapGestureDetectorDetectedSignal END (OK)");
261             Assert.Pass("TapGestureDetectorDetectedSignal");
262         }
263                 
264                 [Test]
265         [Category("P1")]
266         [Description("Test Detected property.")]
267         [Property("SPEC", "Tizen.NUI.TapGestureDetector.Detected A")]
268         [Property("SPEC_URL", "-")]
269         [Property("CRITERIA", "PRW")]
270         [Property("AUTHOR", "guowei.wang@samsung.com")]
271         public void TapGestureDetectorDetected()
272         {
273             tlog.Debug(tag, $"TapGestureDetectorDetected START");
274             TapGestureDetector a1 = new TapGestureDetector();
275                         
276             a1.Detected += OnDetected;
277             a1.Detected -= OnDetected;
278                         
279             a1.Dispose();
280             tlog.Debug(tag, $"TapGestureDetectorDetected END (OK)");
281             Assert.Pass("TapGestureDetectorDetected");
282         }               
283                 
284                 private void OnDetected(object obj, TapGestureDetector.DetectedEventArgs e)
285                 { }     
286     }
287 }