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/LongPressGestureDetector")]
13 internal class PublicLongPressGestureDetectorTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
32 [Description("Create a LongPressGestureDetector object.")]
33 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.LongPressGestureDetector C")]
34 [Property("SPEC_URL", "-")]
35 [Property("CRITERIA", "CONSTR")]
36 [Property("COVPARAM", "")]
37 [Property("AUTHOR", "guowei.wang@samsung.com")]
38 public void LongPressGestureDetectorConstructor()
40 tlog.Debug(tag, $"LongPressGestureDetectorConstructor START");
42 var testingTarget = new LongPressGestureDetector();
43 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
44 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
46 testingTarget.Dispose();
47 tlog.Debug(tag, $"LongPressGestureDetectorConstructor END (OK)");
48 Assert.Pass("LongPressGestureDetectorConstructor");
53 [Description("Create a LongPressGestureDetector object.")]
54 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.LongPressGestureDetector C")]
55 [Property("SPEC_URL", "-")]
56 [Property("CRITERIA", "CONSTR")]
57 [Property("COVPARAM", "")]
58 [Property("AUTHOR", "guowei.wang@samsung.com")]
59 public void LongPressGestureDetectorConstructorWithTouchesRequired()
61 tlog.Debug(tag, $"LongPressGestureDetectorConstructorWithTouchesRequired START");
63 var testingTarget = new LongPressGestureDetector(7);
64 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
65 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
67 testingTarget.Dispose();
68 tlog.Debug(tag, $"LongPressGestureDetectorConstructorWithTouchesRequired END (OK)");
69 Assert.Pass("LongPressGestureDetectorConstructor");
74 [Description("Create a LongPressGestureDetector object.")]
75 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.LongPressGestureDetector C")]
76 [Property("SPEC_URL", "-")]
77 [Property("CRITERIA", "CONSTR")]
78 [Property("COVPARAM", "")]
79 [Property("AUTHOR", "guowei.wang@samsung.com")]
80 public void LongPressGestureDetectorConstructorWithTouchesArea()
82 tlog.Debug(tag, $"LongPressGestureDetectorConstructorWithTouchesArea START");
84 var testingTarget = new LongPressGestureDetector(3, 7);
85 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
86 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
88 testingTarget.Dispose();
89 tlog.Debug(tag, $"LongPressGestureDetectorConstructorWithTouchesArea END (OK)");
90 Assert.Pass("LongPressGestureDetectorConstructor");
95 [Description("Create a LongPressGestureDetector object.")]
96 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.LongPressGestureDetector C")]
97 [Property("SPEC_URL", "-")]
98 [Property("CRITERIA", "CONSTR")]
99 [Property("COVPARAM", "")]
100 [Property("AUTHOR", "guowei.wang@samsung.com")]
101 public void LongPressGestureDetectorConstructorWithLongPressGestureDetector()
103 tlog.Debug(tag, $"LongPressGestureDetectorConstructorWithLongPressGestureDetector START");
105 using (LongPressGestureDetector detector = new LongPressGestureDetector(3, 7))
107 var testingTarget = new LongPressGestureDetector(detector);
108 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
109 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
111 testingTarget.Dispose();
114 tlog.Debug(tag, $"LongPressGestureDetectorConstructorWithLongPressGestureDetector END (OK)");
115 Assert.Pass("LongPressGestureDetectorConstructor");
120 [Description("LongPressGestureDetector SetTouchesRequired")]
121 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.SetTouchesRequired M")]
122 [Property("SPEC_URL", "-")]
123 [Property("CRITERIA", "MR")]
124 [Property("AUTHOR", "guowei.wang@samsung.com")]
125 public void LongPressGestureDetectorSetTouchesRequired()
127 tlog.Debug(tag, $"LongPressGestureDetectorSetTouchesRequired START");
129 var testingTarget = new LongPressGestureDetector(7);
130 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
131 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
135 testingTarget.SetTouchesRequired(3);
139 tlog.Debug(tag, e.Message.ToString());
140 Assert.Fail("Caught Exception : Failed!");
143 tlog.Debug(tag, $"LongPressGestureDetectorSetTouchesRequired END (OK)");
144 Assert.Pass("SetTouchesRequired");
149 [Description("LongPressGestureDetector SetTouchesRequired")]
150 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.SetTouchesRequired M")]
151 [Property("SPEC_URL", "-")]
152 [Property("CRITERIA", "MR")]
153 [Property("AUTHOR", "guowei.wang@samsung.com")]
154 public void LongPressGestureDetectorSetTouchesRequiredWithTouchesArea()
156 tlog.Debug(tag, $"LongPressGestureDetectorSetTouchesRequiredWithTouchesArea START");
158 var testingTarget = new LongPressGestureDetector(7);
159 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
160 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
164 testingTarget.SetTouchesRequired(2, 8);
168 tlog.Debug(tag, e.Message.ToString());
169 Assert.Fail("Caught Exception : Failed!");
172 tlog.Debug(tag, $"LongPressGestureDetectorSetTouchesRequiredWithTouchesArea END (OK)");
173 Assert.Pass("SetTouchesRequired");
178 [Description("LongPressGestureDetector GetMinimumTouchesRequired")]
179 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.GetMinimumTouchesRequired M")]
180 [Property("SPEC_URL", "-")]
181 [Property("CRITERIA", "MR")]
182 [Property("AUTHOR", "guowei.wang@samsung.com")]
183 public void LongPressGestureDetectorGetMinimumTouchesRequired()
185 tlog.Debug(tag, $"LongPressGestureDetectorGetMinimumTouchesRequired START");
187 var testingTarget = new LongPressGestureDetector(7);
188 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
189 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
191 tlog.Debug(tag, "MinimumTouchesRequired : " + testingTarget.GetMinimumTouchesRequired());
193 testingTarget.Dispose();
194 tlog.Debug(tag, $"LongPressGestureDetectorGetMinimumTouchesRequired END (OK)");
195 Assert.Pass("GetMinimumTouchesRequired");
200 [Description("LongPressGestureDetector GetMaximumTouchesRequired")]
201 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.GetMaximumTouchesRequired M")]
202 [Property("SPEC_URL", "-")]
203 [Property("CRITERIA", "MR")]
204 [Property("AUTHOR", "guowei.wang@samsung.com")]
205 public void LongPressGestureDetectorGetMaximumTouchesRequired()
207 var testingTarget = new LongPressGestureDetector(7);
208 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
209 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
211 tlog.Debug(tag, "MaximumTouchesRequired : " + testingTarget.GetMaximumTouchesRequired());
213 testingTarget.Dispose();
215 tlog.Debug(tag, $"LongPressGestureDetectorGetMaximumTouchesRequired END (OK)");
216 Assert.Pass("GetMaximumTouchesRequired");
221 [Description("LongPressGestureDetector GetLongPressGestureDetectorFromPtr")]
222 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.GetLongPressGestureDetectorFromPtr M")]
223 [Property("SPEC_URL", "-")]
224 [Property("CRITERIA", "MR")]
225 [Property("AUTHOR", "guowei.wang@samsung.com")]
226 public void LongPressGestureDetectorGetLongPressGestureDetectorFromPtr()
228 tlog.Debug(tag, $"LongPressGestureDetectorGetLongPressGestureDetectorFromPtr START");
230 using (LongPressGestureDetector detector= new LongPressGestureDetector(3))
232 var testingTarget = LongPressGestureDetector.GetLongPressGestureDetectorFromPtr(LongPressGestureDetector.getCPtr(detector).Handle);
233 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
234 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
236 testingTarget.Dispose();
239 tlog.Debug(tag, $"LongPressGestureDetectorGetLongPressGestureDetectorFromPtr END (OK)");
240 Assert.Pass("GetLongPressGestureDetectorFromPtr");
245 [Description("LongPressGestureDetector DownCast")]
246 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.DownCast M")]
247 [Property("SPEC_URL", "-")]
248 [Property("CRITERIA", "MR")]
249 [Property("AUTHOR", "guowei.wang@samsung.com")]
250 public void LongPressGestureDetectorDownCast()
252 tlog.Debug(tag, $"LongPressGestureDetectorDownCast START");
254 using (LongPressGestureDetector detector = new LongPressGestureDetector())
256 var testingTarget = LongPressGestureDetector.DownCast(detector);
257 Assert.IsNotNull(testingTarget, "Can't create success object LongPressGestureDetector");
258 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
260 testingTarget.Dispose();
263 tlog.Debug(tag, $"LongPressGestureDetectorDownCast END (OK)");
264 Assert.Pass("LongPressGestureDetectorDownCast");
269 [Description("LongPressGestureDetector DetectedSignal")]
270 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.DetectedSignal M")]
271 [Property("SPEC_URL", "-")]
272 [Property("CRITERIA", "MR")]
273 [Property("AUTHOR", "guowei.wang@samsung.com")]
274 public void LongPressGestureDetectorDetectedSignal()
276 tlog.Debug(tag, $"LongPressGestureDetectorDetectedSignal START");
278 using (LongPressGestureDetector detector = new LongPressGestureDetector())
280 var testingTarget = detector.DetectedSignal();
281 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
282 Assert.IsInstanceOf<LongPressGestureDetectedSignal>(testingTarget, "Should be an instance of LongPressGestureDetectedSignal type.");
284 testingTarget.Dispose();
287 tlog.Debug(tag, $"LongPressGestureDetectorDetectedSignal END (OK)");
288 Assert.Pass("LongPressGestureDetectorDetectedSignal");
293 [Description("LongPressGestureDetector getCPtr")]
294 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.getCPtr M")]
295 [Property("SPEC_URL", "-")]
296 [Property("CRITERIA", "MR")]
297 [Property("AUTHOR", "guowei.wang@samsung.com")]
298 public void LongPressGestureDetectorgetCPtr()
300 tlog.Debug(tag, $"LongPressGestureDetectorgetCPtr START");
302 using (LongPressGestureDetector detector = new LongPressGestureDetector())
304 var testingTarget = LongPressGestureDetector.DownCast(detector);
305 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
309 LongPressGestureDetector.getCPtr(testingTarget);
313 tlog.Debug(tag, e.Message.ToString());
314 Assert.Fail("Caught Exception : Failed!");
317 testingTarget.Dispose();
320 tlog.Debug(tag, $"LongPressGestureDetectorgetCPtr END (OK)");
321 Assert.Pass("LongPressGestureDetectorgetCPtr");
326 [Description("Test Detected property.")]
327 [Property("SPEC", "Tizen.NUI.LongPressGestureDetector.Detected A")]
328 [Property("SPEC_URL", "-")]
329 [Property("CRITERIA", "PRW")]
330 [Property("AUTHOR", "guowei.wang@samsung.com")]
331 public void LongPressGestureDetectorDetected()
333 tlog.Debug(tag, $"LongPressGestureDetectorDetected START");
335 using (LongPressGestureDetector detector = new LongPressGestureDetector())
337 var testingTarget = LongPressGestureDetector.DownCast(detector);
338 Assert.IsInstanceOf<LongPressGestureDetector>(testingTarget, "Should be an instance of LongPressGestureDetector type.");
340 testingTarget.Detected += OnDetected;
341 testingTarget.Detected -= OnDetected;
343 testingTarget.Dispose();
346 tlog.Debug(tag, $"LongPressGestureDetectorDetected END (OK)");
347 Assert.Pass("LongPressGestureDetectorDetected");
350 private void OnDetected(object obj, LongPressGestureDetector.DetectedEventArgs e)