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/PinchGestureDetector")]
13 class PublicPinchGestureDetectorTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
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()
38 tlog.Debug(tag, $"PinchGestureDetectorConstructor START");
39 PinchGestureDetector a1 = new PinchGestureDetector();
42 tlog.Debug(tag, $"PinchGestureDetectorConstructor END (OK)");
43 Assert.Pass("PinchGestureDetectorConstructor");
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()
55 tlog.Debug(tag, $"PinchGestureDetectorConstructor START");
57 using (PinchGestureDetector detector = new PinchGestureDetector())
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.");
63 testingTarget.Dispose();
66 tlog.Debug(tag, $"PinchGestureDetectorConstructor END (OK)");
67 Assert.Pass("PinchGestureDetectorConstructor");
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()
79 tlog.Debug(tag, $"PinchGestureDetectorGetPinchGestureDetectorFromPtr START");
80 PinchGestureDetector a1 = new PinchGestureDetector();
82 PinchGestureDetector a2 = PinchGestureDetector.GetPinchGestureDetectorFromPtr(PinchGestureDetector.getCPtr(a1).Handle);
86 tlog.Debug(tag, $"PinchGestureDetectorGetPinchGestureDetectorFromPtr END (OK)");
87 Assert.Pass("PinchGestureDetectorGetPinchGestureDetectorFromPtr");
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()
99 tlog.Debug(tag, $"PinchGestureDetectorDownCast START");
101 using (PinchGestureDetector detector = new PinchGestureDetector())
103 var testingTarget = PinchGestureDetector.DownCast(detector);
104 Assert.IsInstanceOf<PinchGestureDetector>(testingTarget, "Should be an instance of PinchGestureDetector type.");
106 testingTarget.Dispose();
109 tlog.Debug(tag, $"PinchGestureDetectorDownCast END (OK)");
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()
121 tlog.Debug(tag, $"PinchGestureDetectorgetCPtr START");
122 PinchGestureDetector a1 = new PinchGestureDetector();
124 global::System.Runtime.InteropServices.HandleRef b1 = PinchGestureDetector.getCPtr(a1);
128 tlog.Debug(tag, $"PinchGestureDetectorgetCPtr END (OK)");
129 Assert.Pass("PinchGestureDetectorgetCPtr");
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()
141 tlog.Debug(tag, $"PinchGestureDetectorAssign START");
143 using (PinchGestureDetector detector = new PinchGestureDetector())
145 var testingTarget = detector.Assign(detector);
146 Assert.IsInstanceOf<PinchGestureDetector>(testingTarget, "Should be an instance of PinchGestureDetector type.");
148 testingTarget.Dispose();
151 tlog.Debug(tag, $"PinchGestureDetectorAssign END (OK)");
156 [Description("PinchGestureDetector DetectedSignal")]
157 [Property("SPEC", "Tizen.NUI.PinchGestureDetector.DetectedSignal M")]
158 [Property("SPEC_URL", "-")]
159 [Property("CRITERIA", "MR")]
160 [Property("AUTHOR", "guowei.wang@samsung.com")]
161 public void PinchGestureDetectorDetectedSignal()
163 tlog.Debug(tag, $"PinchGestureDetectorDetectedSignal START");
164 PinchGestureDetector a1 = new PinchGestureDetector();
166 PinchGestureDetectedSignal b1 = a1.DetectedSignal();
170 tlog.Debug(tag, $"PinchGestureDetectorDetectedSignal END (OK)");
171 Assert.Pass("PinchGestureDetectorDetectedSignal");
176 [Description("Test Detected property.")]
177 [Property("SPEC", "Tizen.NUI.PinchGestureDetector.Detected A")]
178 [Property("SPEC_URL", "-")]
179 [Property("CRITERIA", "PRW")]
180 [Property("AUTHOR", "guowei.wang@samsung.com")]
181 public void PinchGestureDetectorDetected()
183 tlog.Debug(tag, $"PinchGestureDetectorDetected START");
184 PinchGestureDetector a1 = new PinchGestureDetector();
186 a1.Detected += OnDetected;
187 a1.Detected -= OnDetected;
190 tlog.Debug(tag, $"PinchGestureDetectorDetected END (OK)");
191 Assert.Pass("PinchGestureDetectorDetected");
194 private void OnDetected(object obj, PinchGestureDetector.DetectedEventArgs e)
199 [Description("Test DetectedEventArgs View.")]
200 [Property("SPEC", "Tizen.NUI.DetectedEventArgs.View A")]
201 [Property("SPEC_URL", "-")]
202 [Property("CRITERIA", "PRW")]
203 [Property("AUTHOR", "guowei.wang@samsung.com")]
204 public void PinchGestureDetectedEventArgsView()
206 tlog.Debug(tag, $"PinchGestureDetectedEventArgsView START");
208 var testingTarget = new Tizen.NUI.PinchGestureDetector.DetectedEventArgs();
209 Assert.IsNotNull(testingTarget, "Can't create success object DetectedEventArgs.");
210 Assert.IsInstanceOf<Tizen.NUI.PinchGestureDetector.DetectedEventArgs>(testingTarget, "Should return DetectedEventArgs instance.");
212 using (View view = new View() { Size = new Size(100, 50) })
214 testingTarget.View = view;
215 Assert.AreEqual(100, testingTarget.View.Size.Width, "Should be equal!");
218 testingTarget.PinchGesture = new PinchGesture(Gesture.StateType.Possible);
219 Assert.AreEqual(Gesture.StateType.Possible, testingTarget.PinchGesture.State, "Should be equal!");
221 tlog.Debug(tag, $"PinchGestureDetectedEventArgsView END (OK)");