1 using NUnit.Framework;
2 using NUnit.Framework.TUnit;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("public/Events/PanGesture")]
13 public class PublicPanGestureTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
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()
39 tlog.Debug(tag, $"PanGestureConstructor START");
41 var testingTarget = new PanGesture();
42 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
43 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
45 testingTarget.Dispose();
46 tlog.Debug(tag, $"PanGestureConstructor END (OK)");
47 Assert.Pass("PanGestureConstructor");
52 [Description("Create a PanGesture object.")]
53 [Property("SPEC", "Tizen.NUI.PanGesture.PanGesture C")]
54 [Property("SPEC_URL", "-")]
55 [Property("CRITERIA", "CONSTR")]
56 [Property("COVPARAM", "")]
57 [Property("AUTHOR", "guowei.wang@samsung.com")]
58 public void PanGestureConstructorWithState()
60 tlog.Debug(tag, $"PanGestureConstructorWithState START");
62 var testingTarget = new PanGesture(Gesture.StateType.Finished);
63 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
64 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
66 testingTarget.Dispose();
67 tlog.Debug(tag, $"PanGestureConstructorWithState END (OK)");
68 Assert.Pass("PanGestureConstructor");
73 [Description("Test Velocity property.")]
74 [Property("SPEC", "Tizen.NUI.PanGesture.Velocity A")]
75 [Property("SPEC_URL", "-")]
76 [Property("CRITERIA", "PRW")]
77 [Property("AUTHOR", "guowei.wang@samsung.com")]
78 public void PanGestureVelocity()
80 tlog.Debug(tag, $"PanGestureVelocity START");
82 var testingTarget = new PanGesture(Gesture.StateType.Finished);
83 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
84 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
86 tlog.Debug(tag, "Velocity : " + testingTarget.Velocity);
88 testingTarget.Dispose();
89 tlog.Debug(tag, $"PanGestureVelocity END (OK)");
90 Assert.Pass("PanGestureVelocity");
95 [Description("Test Displacement property.")]
96 [Property("SPEC", "Tizen.NUI.PanGesture.Displacement A")]
97 [Property("SPEC_URL", "-")]
98 [Property("CRITERIA", "PRW")]
99 [Property("AUTHOR", "guowei.wang@samsung.com")]
100 public void PanGestureDisplacement()
102 tlog.Debug(tag, $"PanGestureDisplacement START");
104 var testingTarget = new PanGesture(Gesture.StateType.Finished);
105 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
106 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
108 tlog.Debug(tag, "Displacement : " + testingTarget.Displacement);
110 testingTarget.Dispose();
111 tlog.Debug(tag, $"PanGestureDisplacement END (OK)");
112 Assert.Pass("PanGestureDisplacement");
117 [Description("Test Position property.")]
118 [Property("SPEC", "Tizen.NUI.PanGesture.Position A")]
119 [Property("SPEC_URL", "-")]
120 [Property("CRITERIA", "PRW")]
121 [Property("AUTHOR", "guowei.wang@samsung.com")]
122 public void PanGesturePosition()
124 tlog.Debug(tag, $"PanGesturePosition START");
126 var testingTarget = new PanGesture(Gesture.StateType.Finished);
127 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
128 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
130 tlog.Debug(tag, "Position : " + testingTarget.Position);
132 testingTarget.Dispose();
133 tlog.Debug(tag, $"PanGesturePosition END (OK)");
134 Assert.Pass("PanGesturePosition");
139 [Description("Test ScreenVelocity property.")]
140 [Property("SPEC", "Tizen.NUI.PanGesture.ScreenVelocity A")]
141 [Property("SPEC_URL", "-")]
142 [Property("CRITERIA", "PRW")]
143 [Property("AUTHOR", "guowei.wang@samsung.com")]
144 public void PanGestureScreenVelocity()
146 tlog.Debug(tag, $"PanGestureScreenVelocity START");
148 var testingTarget = new PanGesture(Gesture.StateType.Finished);
149 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
150 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
152 tlog.Debug(tag, "ScreenVelocity : " + testingTarget.ScreenVelocity);
154 testingTarget.Dispose();
155 tlog.Debug(tag, $"PanGestureScreenVelocity END (OK)");
156 Assert.Pass("PanGestureScreenVelocity");
161 [Description("Test ScreenDisplacement property.")]
162 [Property("SPEC", "Tizen.NUI.PanGesture.ScreenDisplacement A")]
163 [Property("SPEC_URL", "-")]
164 [Property("CRITERIA", "PRW")]
165 [Property("AUTHOR", "guowei.wang@samsung.com")]
166 public void PanGestureScreenDisplacement()
168 tlog.Debug(tag, $"PanGestureScreenDisplacement START");
170 var testingTarget = new PanGesture(Gesture.StateType.Finished);
171 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
172 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
174 tlog.Debug(tag, "ScreenDisplacement : " + testingTarget.ScreenDisplacement);
176 testingTarget.Dispose();
177 tlog.Debug(tag, $"PanGestureScreenDisplacement END (OK)");
178 Assert.Pass("PanGestureScreenDisplacement");
183 [Description("Test ScreenPosition property.")]
184 [Property("SPEC", "Tizen.NUI.PanGesture.ScreenPosition A")]
185 [Property("SPEC_URL", "-")]
186 [Property("CRITERIA", "PRW")]
187 [Property("AUTHOR", "guowei.wang@samsung.com")]
188 public void PanGestureScreenPosition()
190 tlog.Debug(tag, $"PanGestureScreenPosition START");
192 var testingTarget = new PanGesture(Gesture.StateType.Finished);
193 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
194 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
196 tlog.Debug(tag, "ScreenPosition : " + testingTarget.ScreenPosition);
198 testingTarget.Dispose();
199 tlog.Debug(tag, $"PanGestureScreenPosition END (OK)");
200 Assert.Pass("PanGestureScreenPosition");
205 [Description("Test NumberOfTouches property.")]
206 [Property("SPEC", "Tizen.NUI.PanGesture.NumberOfTouches A")]
207 [Property("SPEC_URL", "-")]
208 [Property("CRITERIA", "PRW")]
209 [Property("AUTHOR", "guowei.wang@samsung.com")]
210 public void PanGestureNumberOfTouches()
212 tlog.Debug(tag, $"PanGestureNumberOfTouches START");
214 var testingTarget = new PanGesture(Gesture.StateType.Finished);
215 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
216 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
218 tlog.Debug(tag, "NumberOfTouches : " + testingTarget.NumberOfTouches);
220 testingTarget.Dispose();
221 tlog.Debug(tag, $"PanGestureNumberOfTouches END (OK)");
222 Assert.Pass("PanGestureNumberOfTouches");
227 [Description("Test GetSpeed property.")]
228 [Property("SPEC", "Tizen.NUI.PanGesture.GetSpeed M")]
229 [Property("SPEC_URL", "-")]
230 [Property("CRITERIA", "MR")]
231 [Property("AUTHOR", "guowei.wang@samsung.com")]
232 public void PanGestureGetSpeed()
234 tlog.Debug(tag, $"PanGestureGetSpeed START");
236 var testingTarget = new PanGesture(Gesture.StateType.Finished);
237 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
238 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
240 tlog.Debug(tag, "GetSpeed : " + testingTarget.GetSpeed());
242 testingTarget.Dispose();
243 tlog.Debug(tag, $"PanGestureGetSpeed END (OK)");
244 Assert.Pass("PanGestureGetSpeed");
249 [Description("Test GetDistance property.")]
250 [Property("SPEC", "Tizen.NUI.PanGesture.GetDistance M")]
251 [Property("SPEC_URL", "-")]
252 [Property("CRITERIA", "MR")]
253 [Property("AUTHOR", "guowei.wang@samsung.com")]
254 public void PanGestureGetDistance()
256 tlog.Debug(tag, $"PanGestureGetDistance START");
258 var testingTarget = new PanGesture(Gesture.StateType.Finished);
259 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
260 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
262 tlog.Debug(tag, "GetDistance : " + testingTarget.GetDistance());
264 testingTarget.Dispose();
265 tlog.Debug(tag, $"PanGestureGetDistance END (OK)");
266 Assert.Pass("PanGestureGetDistance");
271 [Description("Test GetScreenSpeed property.")]
272 [Property("SPEC", "Tizen.NUI.PanGesture.GetScreenSpeed M")]
273 [Property("SPEC_URL", "-")]
274 [Property("CRITERIA", "MR")]
275 [Property("AUTHOR", "guowei.wang@samsung.com")]
276 public void PanGestureGetScreenSpeed()
278 tlog.Debug(tag, $"PanGestureGetScreenSpeed START");
280 var testingTarget = new PanGesture(Gesture.StateType.Finished);
281 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
282 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
284 tlog.Debug(tag, "GetScreenSpeed : " + testingTarget.GetScreenSpeed());
286 testingTarget.Dispose();
287 tlog.Debug(tag, $"PanGestureGetScreenSpeed END (OK)");
288 Assert.Pass("PanGestureGetScreenSpeed");
293 [Description("Test GetScreenDistance property.")]
294 [Property("SPEC", "Tizen.NUI.PanGesture.GetScreenDistance M")]
295 [Property("SPEC_URL", "-")]
296 [Property("CRITERIA", "MR")]
297 [Property("AUTHOR", "guowei.wang@samsung.com")]
298 public void PanGestureGetScreenDistance()
300 tlog.Debug(tag, $"PanGestureGetScreenDistance START");
302 var testingTarget = new PanGesture(Gesture.StateType.Finished);
303 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
304 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
306 tlog.Debug(tag, "GetScreenDistance : " + testingTarget.GetScreenDistance());
308 testingTarget.Dispose();
309 tlog.Debug(tag, $"PanGestureGetScreenDistance END (OK)");
310 Assert.Pass("PanGestureGetScreenDistance");
315 [Description("Test getCPtr property.")]
316 [Property("SPEC", "Tizen.NUI.PanGesture.getCPtr M")]
317 [Property("SPEC_URL", "-")]
318 [Property("CRITERIA", "MR")]
319 [Property("AUTHOR", "guowei.wang@samsung.com")]
320 public void PanGesturegetCPtr()
322 tlog.Debug(tag, $"PanGesturegetCPtr START");
324 using (PanGesture gesture = new PanGesture())
328 PanGesture.getCPtr(gesture);
332 tlog.Debug(tag, e.Message.ToString());
333 Assert.Fail("Caught Exception : Failed!");
337 tlog.Debug(tag, $"PanGesturegetCPtr END (OK)");
338 Assert.Pass("PanGestureCPtr");
343 [Description("Test GetPanGestureFromPtr property.")]
344 [Property("SPEC", "Tizen.NUI.PanGesture.GetPanGestureFromPtr M")]
345 [Property("SPEC_URL", "-")]
346 [Property("CRITERIA", "MR")]
347 [Property("AUTHOR", "guowei.wang@samsung.com")]
348 public void PanGestureGetPanGestureFromPtr()
350 tlog.Debug(tag, $"PanGestureGetPanGestureFromPtr START");
352 using (PanGesture gesture = new PanGesture())
354 var testingTarget = PanGesture.GetPanGestureFromPtr(PanGesture.getCPtr(gesture).Handle);
355 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
356 Assert.IsInstanceOf<PanGesture>(testingTarget, "Should be an instance of PanGesture type.");
358 testingTarget.Dispose();
361 tlog.Debug(tag, $"PanGestureGetPanGestureFromPtr END (OK)");
362 Assert.Pass("PanGestureGetPanGestureFromPtr");