e120de9cf6df5478cbaf68a2a4f135aabd5aab74
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Events / TSPinchGestureDetector.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/PinchGestureDetector")]
13     class PublicPinchGestureDetectorTest
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("PinchGestureDetector constructor")]
32         [Property("SPEC", "Tizen.NUI.PinchGestureDetector.PinchGestureDetector C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("AUTHOR", "guowei.wang@samsung.com")]
36         public void PinchGestureDetectorConstructor()
37         {
38             tlog.Debug(tag, $"PinchGestureDetectorConstructor START");
39             PinchGestureDetector a1 = new PinchGestureDetector();
40
41             a1.Dispose();
42             tlog.Debug(tag, $"PinchGestureDetectorConstructor END (OK)");
43             Assert.Pass("PinchGestureDetectorConstructor");
44         }
45
46         [Test]
47         [Category("P1")]
48         [Description("PinchGestureDetector constructor")]
49         [Property("SPEC", "Tizen.NUI.PinchGestureDetector.PinchGestureDetector C")]
50         [Property("SPEC_URL", "-")]
51         [Property("CRITERIA", "CONSTR")]
52         [Property("AUTHOR", "guowei.wang@samsung.com")]
53         public void PinchGestureDetectorConstructorWithPinchGestureDetector()
54         {
55             tlog.Debug(tag, $"PinchGestureDetectorConstructor START");
56
57             using (PinchGestureDetector detector = new PinchGestureDetector())
58             {
59                 var testingTarget = new PinchGestureDetector(detector);
60                 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
61                 Assert.IsInstanceOf<PinchGestureDetector>(testingTarget, "Should be an instance of PinchGestureDetector type.");
62
63                 testingTarget.Dispose();
64             }
65
66             tlog.Debug(tag, $"PinchGestureDetectorConstructor END (OK)");
67             Assert.Pass("PinchGestureDetectorConstructor");
68         }
69
70         [Test]
71         [Category("P1")]
72         [Description("PinchGestureDetector GetPinchGestureDetectorFromPtr")]
73         [Property("SPEC", "Tizen.NUI.PinchGestureDetector.GetPinchGestureDetectorFromPtr M")]
74         [Property("SPEC_URL", "-")]
75         [Property("CRITERIA", "MR")]
76         [Property("AUTHOR", "guowei.wang@samsung.com")]
77         public void PinchGestureDetectorGetPinchGestureDetectorFromPtr()
78         {
79             tlog.Debug(tag, $"PinchGestureDetectorGetPinchGestureDetectorFromPtr START");
80             PinchGestureDetector a1 = new PinchGestureDetector();
81
82             PinchGestureDetector a2 = PinchGestureDetector.GetPinchGestureDetectorFromPtr(PinchGestureDetector.getCPtr(a1).Handle);
83                         
84             a1.Dispose();
85             
86             tlog.Debug(tag, $"PinchGestureDetectorGetPinchGestureDetectorFromPtr END (OK)");
87             Assert.Pass("PinchGestureDetectorGetPinchGestureDetectorFromPtr");
88         }
89
90         [Test]
91         [Category("P1")]
92         [Description("PinchGestureDetector DownCast")]
93         [Property("SPEC", "Tizen.NUI.PinchGestureDetector.DownCast M")]
94         [Property("SPEC_URL", "-")]
95         [Property("CRITERIA", "MR")]
96         [Property("AUTHOR", "guowei.wang@samsung.com")]
97         public void PinchGestureDetectorDownCast()
98         {
99             tlog.Debug(tag, $"PinchGestureDetectorDownCast START");
100
101             using (PinchGestureDetector detector = new PinchGestureDetector())
102             {
103                 var testingTarget = PinchGestureDetector.DownCast(detector);
104                 Assert.IsInstanceOf<PinchGestureDetector>(testingTarget, "Should be an instance of PinchGestureDetector type.");
105
106                 testingTarget.Dispose();
107             }
108
109             tlog.Debug(tag, $"PinchGestureDetectorDownCast END (OK)");
110         }
111
112         [Test]
113         [Category("P1")]
114         [Description("PinchGestureDetector getCPtr")]
115         [Property("SPEC", "Tizen.NUI.PinchGestureDetector.getCPtr M")]
116         [Property("SPEC_URL", "-")]
117         [Property("CRITERIA", "MR")]
118         [Property("AUTHOR", "guowei.wang@samsung.com")]
119         public void PinchGestureDetectorgetCPtr()
120         {
121             tlog.Debug(tag, $"PinchGestureDetectorgetCPtr START");
122             PinchGestureDetector a1 = new PinchGestureDetector();
123
124             global::System.Runtime.InteropServices.HandleRef b1 = PinchGestureDetector.getCPtr(a1);
125
126             a1.Dispose();
127             
128             tlog.Debug(tag, $"PinchGestureDetectorgetCPtr END (OK)");
129             Assert.Pass("PinchGestureDetectorgetCPtr");
130         }
131
132                 [Test]
133         [Category("P1")]
134         [Description("PinchGestureDetector Assign")]
135         [Property("SPEC", "Tizen.NUI.PinchGestureDetector.Assign M")]
136         [Property("SPEC_URL", "-")]
137         [Property("CRITERIA", "MR")]
138         [Property("AUTHOR", "guowei.wang@samsung.com")]
139         public void PinchGestureDetectorAssign()
140         {
141             tlog.Debug(tag, $"PinchGestureDetectorAssign START");
142             PinchGestureDetector a1 = new PinchGestureDetector();
143
144             PinchGestureDetector b1 = a1;
145                         
146             a1.Dispose();
147             b1.Dispose();
148             
149             tlog.Debug(tag, $"PinchGestureDetectorAssign END (OK)");
150             Assert.Pass("PinchGestureDetectorAssign");                  
151         }
152                 
153         [Test]
154         [Category("P1")]
155         [Description("PinchGestureDetector DetectedSignal")]
156         [Property("SPEC", "Tizen.NUI.PinchGestureDetector.DetectedSignal M")]
157         [Property("SPEC_URL", "-")]
158         [Property("CRITERIA", "MR")]
159         [Property("AUTHOR", "guowei.wang@samsung.com")]
160         public void PinchGestureDetectorDetectedSignal()
161         {
162             tlog.Debug(tag, $"PinchGestureDetectorDetectedSignal START");
163             PinchGestureDetector a1 = new PinchGestureDetector();
164
165             PinchGestureDetectedSignal b1 = a1.DetectedSignal();
166                         
167             a1.Dispose();
168             
169             tlog.Debug(tag, $"PinchGestureDetectorDetectedSignal END (OK)");
170             Assert.Pass("PinchGestureDetectorDetectedSignal");
171         }
172
173                 [Test]
174         [Category("P1")]
175         [Description("Test Detected property.")]
176         [Property("SPEC", "Tizen.NUI.PinchGestureDetector.Detected A")]
177         [Property("SPEC_URL", "-")]
178         [Property("CRITERIA", "PRW")]
179         [Property("AUTHOR", "guowei.wang@samsung.com")]
180         public void PinchGestureDetectorDetected()
181         {
182             tlog.Debug(tag, $"PinchGestureDetectorDetected START");
183             PinchGestureDetector a1 = new PinchGestureDetector();
184                         
185             a1.Detected += OnDetected;
186             a1.Detected -= OnDetected;
187                         
188             a1.Dispose();
189             tlog.Debug(tag, $"PinchGestureDetectorDetected END (OK)");
190             Assert.Pass("PinchGestureDetectorDetected");
191         }
192                 
193                 private void OnDetected(object obj, PinchGestureDetector.DetectedEventArgs e)
194                 { }     
195     }
196 }