3ba6d6d7eacb8088db403d7e767734763060a2c2
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Events / TSPanGesture.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/PanGesture")]
13     public class PublicPanGestureTest
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("Create a PanGesture object.")]
32         [Property("SPEC", "Tizen.NUI.PanGesture.PanGesture C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("COVPARAM", "")]
36         [Property("AUTHOR", "guowei.wang@samsung.com")]
37         public void PanGestureConstructor()
38         {
39             tlog.Debug(tag, $"PanGestureConstructor START");
40             PanGesture a1 = new PanGesture();
41
42             Gesture.StateType state = Gesture.StateType.Finished;
43             PanGesture a2 = new PanGesture(state);           
44             
45             a2.Dispose();
46             a1.Dispose();
47             tlog.Debug(tag, $"PanGestureConstructor END (OK)");
48             Assert.Pass("PanGestureConstructor");
49         }
50
51         [Test]
52         [Category("P1")]
53         [Description("Test Velocity property.")]
54         [Property("SPEC", "Tizen.NUI.PanGesture.Velocity A")]
55         [Property("SPEC_URL", "-")]
56         [Property("CRITERIA", "PRW")]
57         [Property("AUTHOR", "guowei.wang@samsung.com")]
58         public void PanGestureVelocity()
59         {
60             tlog.Debug(tag, $"PanGestureVelocity START");
61             PanGesture a1 = new PanGesture();
62             Vector2 v1 = a1.Velocity;
63
64             a1.Dispose();
65             
66             tlog.Debug(tag, $"PanGestureVelocity END (OK)");
67             Assert.Pass("PanGestureVelocity");
68         }
69
70         [Test]
71         [Category("P1")]
72         [Description("Test Displacement property.")]
73         [Property("SPEC", "Tizen.NUI.PanGesture.Displacement A")]
74         [Property("SPEC_URL", "-")]
75         [Property("CRITERIA", "PRW")]
76         [Property("AUTHOR", "guowei.wang@samsung.com")]
77         public void PanGestureDisplacement()
78         {
79             tlog.Debug(tag, $"PanGestureDisplacement START");
80             PanGesture a1 = new PanGesture();
81             Vector2 v1 = a1.Displacement;
82
83             a1.Dispose();
84             
85             tlog.Debug(tag, $"PanGestureDisplacement END (OK)");
86             Assert.Pass("PanGestureDisplacement");
87         }
88
89         [Test]
90         [Category("P1")]
91         [Description("Test Position property.")]
92         [Property("SPEC", "Tizen.NUI.PanGesture.Position A")]
93         [Property("SPEC_URL", "-")]
94         [Property("CRITERIA", "PRW")]
95         [Property("AUTHOR", "guowei.wang@samsung.com")]
96         public void PanGesturePosition()
97         {
98             tlog.Debug(tag, $"PanGesturePosition START");
99             PanGesture a1 = new PanGesture();
100             Vector2 v1 = a1.Position;
101
102             a1.Dispose();
103             
104             tlog.Debug(tag, $"PanGesturePosition END (OK)");
105             Assert.Pass("PanGesturePosition");
106         }
107
108         [Test]
109         [Category("P1")]
110         [Description("Test ScreenVelocity property.")]
111         [Property("SPEC", "Tizen.NUI.PanGesture.ScreenVelocity A")]
112         [Property("SPEC_URL", "-")]
113         [Property("CRITERIA", "PRW")]
114         [Property("AUTHOR", "guowei.wang@samsung.com")]
115         public void PanGestureScreenVelocity()
116         {
117             tlog.Debug(tag, $"PanGestureScreenVelocity START");
118             PanGesture a1 = new PanGesture();
119             Vector2 v1 = a1.ScreenVelocity;
120
121             a1.Dispose();
122             
123             tlog.Debug(tag, $"PanGestureScreenVelocity END (OK)");
124             Assert.Pass("PanGestureScreenVelocity");
125         }
126
127         [Test]
128         [Category("P1")]
129         [Description("Test ScreenDisplacement property.")]
130         [Property("SPEC", "Tizen.NUI.PanGesture.ScreenDisplacement A")]
131         [Property("SPEC_URL", "-")]
132         [Property("CRITERIA", "PRW")]
133         [Property("AUTHOR", "guowei.wang@samsung.com")]
134         public void PanGestureScreenDisplacement()
135         {
136             tlog.Debug(tag, $"PanGestureScreenDisplacement START");
137             PanGesture a1 = new PanGesture();
138             Vector2 v1 = a1.ScreenDisplacement;
139
140             a1.Dispose();
141             
142             tlog.Debug(tag, $"PanGestureScreenDisplacement END (OK)");
143             Assert.Pass("PanGestureScreenDisplacement");
144         }
145
146         [Test]
147         [Category("P1")]
148         [Description("Test ScreenPosition property.")]
149         [Property("SPEC", "Tizen.NUI.PanGesture.ScreenPosition A")]
150         [Property("SPEC_URL", "-")]
151         [Property("CRITERIA", "PRW")]
152         [Property("AUTHOR", "guowei.wang@samsung.com")]
153         public void PanGestureScreenPosition()
154         {
155             tlog.Debug(tag, $"PanGestureScreenPosition START");
156             PanGesture a1 = new PanGesture();
157             Vector2 v1 = a1.ScreenPosition;
158
159             a1.Dispose();
160             
161             tlog.Debug(tag, $"PanGestureScreenPosition END (OK)");
162             Assert.Pass("PanGestureScreenPosition");
163         }
164
165         [Test]
166         [Category("P1")]
167         [Description("Test NumberOfTouches property.")]
168         [Property("SPEC", "Tizen.NUI.PanGesture.NumberOfTouches A")]
169         [Property("SPEC_URL", "-")]
170         [Property("CRITERIA", "PRW")]
171         [Property("AUTHOR", "guowei.wang@samsung.com")]
172         public void PanGestureNumberOfTouches()
173         {
174             tlog.Debug(tag, $"PanGestureNumberOfTouches START");
175             PanGesture a1 = new PanGesture();
176             uint b1 = a1.NumberOfTouches;
177
178             a1.Dispose();
179             
180             tlog.Debug(tag, $"PanGestureNumberOfTouches END (OK)");
181             Assert.Pass("PanGestureNumberOfTouches");
182         }
183
184         [Test]
185         [Category("P1")]
186         [Description("Test GetSpeed property.")]
187         [Property("SPEC", "Tizen.NUI.PanGesture.GetSpeed M")]
188         [Property("SPEC_URL", "-")]
189         [Property("CRITERIA", "MR")]
190         [Property("AUTHOR", "guowei.wang@samsung.com")]
191         public void PanGestureGetSpeed()
192         {
193             tlog.Debug(tag, $"PanGestureGetSpeed START");
194             PanGesture a1 = new PanGesture();
195             float f1 = a1.GetSpeed();
196
197             a1.Dispose();
198             
199             tlog.Debug(tag, $"PanGestureGetSpeed END (OK)");
200             Assert.Pass("PanGestureGetSpeed");
201         }
202
203         [Test]
204         [Category("P1")]
205         [Description("Test GetDistance property.")]
206         [Property("SPEC", "Tizen.NUI.PanGesture.GetDistance M")]
207         [Property("SPEC_URL", "-")]
208         [Property("CRITERIA", "MR")]
209         [Property("AUTHOR", "guowei.wang@samsung.com")]
210         public void PanGestureGetDistance()
211         {
212             tlog.Debug(tag, $"PanGestureGetDistance START");
213             PanGesture a1 = new PanGesture();
214             float f1 = a1.GetDistance();
215
216             a1.Dispose();
217             
218             tlog.Debug(tag, $"PanGestureGetDistance END (OK)");
219             Assert.Pass("PanGestureGetDistance");
220         }
221
222         [Test]
223         [Category("P1")]
224         [Description("Test GetScreenSpeed property.")]
225         [Property("SPEC", "Tizen.NUI.PanGesture.GetScreenSpeed M")]
226         [Property("SPEC_URL", "-")]
227         [Property("CRITERIA", "MR")]
228         [Property("AUTHOR", "guowei.wang@samsung.com")]
229         public void PanGestureGetScreenSpeed()
230         {
231             tlog.Debug(tag, $"PanGestureGetScreenSpeed START");
232             PanGesture a1 = new PanGesture();
233             float f1 = a1.GetScreenSpeed();
234
235             a1.Dispose();
236             
237             tlog.Debug(tag, $"PanGestureGetScreenSpeed END (OK)");
238             Assert.Pass("PanGestureGetScreenSpeed");
239         }
240
241         [Test]
242         [Category("P1")]
243         [Description("Test GetScreenDistance property.")]
244         [Property("SPEC", "Tizen.NUI.PanGesture.GetScreenDistance M")]
245         [Property("SPEC_URL", "-")]
246         [Property("CRITERIA", "MR")]
247         [Property("AUTHOR", "guowei.wang@samsung.com")]
248         public void PanGestureGetScreenDistance()
249         {
250             tlog.Debug(tag, $"PanGestureGetScreenDistance START");
251             PanGesture a1 = new PanGesture();
252             float f1 = a1.GetScreenDistance();
253
254             a1.Dispose();
255             
256             tlog.Debug(tag, $"PanGestureGetScreenDistance END (OK)");
257             Assert.Pass("PanGestureGetScreenDistance");
258         }
259
260         [Test]
261         [Category("P1")]
262         [Description("Test getCPtr property.")]
263         [Property("SPEC", "Tizen.NUI.PanGesture.getCPtr M")]
264         [Property("SPEC_URL", "-")]
265         [Property("CRITERIA", "MR")]
266         [Property("AUTHOR", "guowei.wang@samsung.com")]
267         public void PanGesturegetCPtr()
268         {
269             tlog.Debug(tag, $"PanGesturegetCPtr START");
270             PanGesture a1 = new PanGesture();
271             global::System.Runtime.InteropServices.HandleRef ptr = PanGesture.getCPtr(a1);
272
273             a1.Dispose();
274
275             tlog.Debug(tag, $"PanGesturegetCPtr END (OK)");
276             Assert.Pass("PanGestureCPtr");
277         }
278
279         [Test]
280         [Category("P1")]
281         [Description("Test GetPanGestureFromPtr property.")]
282         [Property("SPEC", "Tizen.NUI.PanGesture.GetPanGestureFromPtr M")]
283         [Property("SPEC_URL", "-")]
284         [Property("CRITERIA", "MR")]
285         [Property("AUTHOR", "guowei.wang@samsung.com")]
286         public void PanGestureGetPanGestureFromPtr()
287         {
288             tlog.Debug(tag, $"PanGestureGetPanGestureFromPtr START");
289             PanGesture a1 = new PanGesture();
290             PanGesture a2 = PanGesture.GetPanGestureFromPtr(PanGesture.getCPtr(a1).Handle);
291             a1.Dispose();
292             tlog.Debug(tag, $"PanGestureGetPanGestureFromPtr END (OK)");
293             Assert.Pass("PanGestureGetPanGestureFromPtr");
294         }
295     }
296 }