[NUI] Update NUI.Devel to fix block and crash issues.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Events / TSWheel.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/Wheel")]
13     class PublicWheelTest
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("Wheel constructor")]
32         [Property("SPEC", "Tizen.NUI.Wheel.Wheel C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("AUTHOR", "guowei.wang@samsung.com")]
36         public void WheelConstructor()
37         {
38             tlog.Debug(tag, $"WheelConstructor START");
39                                     
40             var testingTarget = new Wheel();
41             Assert.IsNotNull(testingTarget, "Can't create success object Hover");
42             Assert.IsInstanceOf<Wheel>(testingTarget, "Should be an instance of Wheel type.");
43
44             testingTarget.Dispose();
45             tlog.Debug(tag, $"WheelConstructor END (OK)");
46             Assert.Pass("WheelConstructor");
47         }
48
49         [Test]
50         [Category("P1")]
51         [Description("Wheel constructor")]
52         [Property("SPEC", "Tizen.NUI.Wheel.Wheel C")]
53         [Property("SPEC_URL", "-")]
54         [Property("CRITERIA", "CONSTR")]
55         [Property("AUTHOR", "guowei.wang@samsung.com")]
56         public void WheelConstructorWithWheelType()
57         {
58             tlog.Debug(tag, $"WheelConstructorWithWheelType START");
59
60             using (Vector2 vector = new Vector2(0.0f, 0.0f))
61             {
62                 var testingTarget = new Wheel(Wheel.WheelType.MouseWheel, 0, 0, vector, 0, 123);
63                 Assert.IsNotNull(testingTarget, "Can't create success object Hover");
64                 Assert.IsInstanceOf<Wheel>(testingTarget, "Should be an instance of Wheel type.");
65
66                 testingTarget.Dispose();
67             }
68
69             tlog.Debug(tag, $"WheelConstructorWithWheelType END (OK)");
70             Assert.Pass("WheelConstructor");
71         }
72
73         [Test]
74         [Category("P1")]
75         [Description("Test Type property.")]
76         [Property("SPEC", "Tizen.NUI.Wheel.Type A")]
77         [Property("SPEC_URL", "-")]
78         [Property("CRITERIA", "PRW")]
79         [Property("AUTHOR", "guowei.wang@samsung.com")]
80         public void WheelType()
81         {
82             tlog.Debug(tag, $"WheelType START");
83             Wheel a1 = new Wheel();
84
85             Wheel.WheelType b1 = a1.Type;
86             
87             tlog.Debug(tag, $"WheelType END (OK)");
88             Assert.Pass("WheelType");
89         }
90
91         [Test]
92         [Category("P1")]
93         [Description("Test Direction property.")]
94         [Property("SPEC", "Tizen.NUI.Wheel.Direction A")]
95         [Property("SPEC_URL", "-")]
96         [Property("CRITERIA", "PRW")]
97         [Property("AUTHOR", "guowei.wang@samsung.com")]
98         public void WheelDirection()
99         {
100             tlog.Debug(tag, $"WheelDirection START");
101             Wheel a1 = new Wheel();
102
103             int b1 = a1.Direction;
104             
105             tlog.Debug(tag, $"WheelDirection END (OK)");
106             Assert.Pass("WheelDirection");
107         }
108
109         [Test]
110         [Category("P1")]
111         [Description("Test Modifiers property.")]
112         [Property("SPEC", "Tizen.NUI.Wheel.Modifiers A")]
113         [Property("SPEC_URL", "-")]
114         [Property("CRITERIA", "PRW")]
115         [Property("AUTHOR", "guowei.wang@samsung.com")]
116         public void WheelModifiers()
117         {
118             tlog.Debug(tag, $"WheelModifiers START");
119             Wheel a1 = new Wheel();
120
121             uint b1 = a1.Modifiers;
122             
123             tlog.Debug(tag, $"WheelModifiers END (OK)");
124             Assert.Pass("WheelModifiers");
125         }
126
127         [Test]
128         [Category("P1")]
129         [Description("Test Point property.")]
130         [Property("SPEC", "Tizen.NUI.Wheel.Point A")]
131         [Property("SPEC_URL", "-")]
132         [Property("CRITERIA", "PRW")]
133         [Property("AUTHOR", "guowei.wang@samsung.com")]
134         public void WheelPoint()
135         {
136             tlog.Debug(tag, $"WheelPoint START");
137             Wheel a1 = new Wheel();
138
139             Vector2 v1 = a1.Point;
140             
141             tlog.Debug(tag, $"WheelPoint END (OK)");
142             Assert.Pass("WheelPoint");
143         }
144
145         [Test]
146         [Category("P1")]
147         [Description("Test Z property.")]
148         [Property("SPEC", "Tizen.NUI.Wheel.Z A")]
149         [Property("SPEC_URL", "-")]
150         [Property("CRITERIA", "PRW")]
151         [Property("AUTHOR", "guowei.wang@samsung.com")]
152         public void WheelZ()
153         {
154             tlog.Debug(tag, $"WheelZ START");
155             Wheel a1 = new Wheel();
156
157             int b1 = a1.Z;
158             
159             tlog.Debug(tag, $"WheelZ END (OK)");
160             Assert.Pass("WheelZ");
161         }
162
163         [Test]
164         [Category("P1")]
165         [Description("Test TimeStamp property.")]
166         [Property("SPEC", "Tizen.NUI.Wheel.TimeStamp A")]
167         [Property("SPEC_URL", "-")]
168         [Property("CRITERIA", "PRW")]
169         [Property("AUTHOR", "guowei.wang@samsung.com")]
170         public void WheelTimeStamp()
171         {
172             tlog.Debug(tag, $"WheelTimeStamp START");
173             Wheel a1 = new Wheel();
174
175             uint b1 = a1.TimeStamp;
176             
177             tlog.Debug(tag, $"WheelTimeStamp END (OK)");
178             Assert.Pass("WheelTimeStamp");
179         }
180
181         [Test]
182         [Category("P1")]
183         [Description("Wheel IsShiftModifier")]
184         [Property("SPEC", "Tizen.NUI.Wheel.IsShiftModifier M")]
185         [Property("SPEC_URL", "-")]
186         [Property("CRITERIA", "MR")]
187         [Property("AUTHOR", "guowei.wang@samsung.com")]
188         public void WheelIsShiftModifier()
189         {
190             tlog.Debug(tag, $"WheelIsShiftModifier START");
191             Wheel a1 = new Wheel();
192             bool b1 = a1.IsShiftModifier();
193             
194             tlog.Debug(tag, $"WheelIsShiftModifier END (OK)");
195             Assert.Pass("WheelIsShiftModifier");
196         }
197
198         [Test]
199         [Category("P1")]
200         [Description("Wheel IsCtrlModifier")]
201         [Property("SPEC", "Tizen.NUI.Wheel.IsCtrlModifier M")]
202         [Property("SPEC_URL", "-")]
203         [Property("CRITERIA", "MR")]
204         [Property("AUTHOR", "guowei.wang@samsung.com")]
205         public void WheelIsCtrlModifier()
206         {
207             tlog.Debug(tag, $"WheelIsCtrlModifier START");
208             Wheel a1 = new Wheel();
209             bool b1 = a1.IsCtrlModifier();
210             
211             tlog.Debug(tag, $"WheelIsCtrlModifier END (OK)");
212             Assert.Pass("WheelIsCtrlModifier");
213         }
214
215         [Test]
216         [Category("P1")]
217         [Description("Wheel IsAltModifier")]
218         [Property("SPEC", "Tizen.NUI.Wheel.IsAltModifier M")]
219         [Property("SPEC_URL", "-")]
220         [Property("CRITERIA", "MR")]
221         [Property("AUTHOR", "guowei.wang@samsung.com")]
222         public void WheelIsAltModifier()
223         {
224             tlog.Debug(tag, $"WheelIsAltModifier START");
225             Wheel a1 = new Wheel();
226             bool b1 = a1.IsAltModifier();
227             
228             tlog.Debug(tag, $"WheelIsAltModifier END (OK)");
229             Assert.Pass("WheelIsAltModifier");
230         }
231
232         [Test]
233         [Category("P1")]
234         [Description("Wheel getCPtr")]
235         [Property("SPEC", "Tizen.NUI.Wheel.getCPtr M")]
236         [Property("SPEC_URL", "-")]
237         [Property("CRITERIA", "MR")]
238         [Property("AUTHOR", "guowei.wang@samsung.com")]
239         public void WheelgetCPtr()
240         {
241             tlog.Debug(tag, $"WheelgetCPtr START");
242             Wheel a1 = new Wheel();
243             global::System.Runtime.InteropServices.HandleRef b1 = Wheel.getCPtr(a1);
244             
245             tlog.Debug(tag, $"WheelgetCPtr END (OK)");
246             Assert.Pass("WheelgetCPtr");
247         }
248
249         [Test]
250         [Category("P1")]
251         [Description("Wheel GetWheelFromPtr")]
252         [Property("SPEC", "Tizen.NUI.Wheel.GetWheelFromPtr M")]
253         [Property("SPEC_URL", "-")]
254         [Property("CRITERIA", "MR")]
255         [Property("AUTHOR", "guowei.wang@samsung.com")]
256         public void WheelGetWheelFromPtr()
257         {
258             tlog.Debug(tag, $"WheelGetWheelFromPtr START");
259             Wheel a1 = new Wheel();
260
261             Wheel a2 = Wheel.GetWheelFromPtr(Wheel.getCPtr(a1).Handle);
262
263             a1.Dispose();
264             
265             tlog.Debug(tag, $"WheelGetWheelFromPtr END (OK)");
266             Assert.Pass("WheelGetWheelFromPtr");
267         }
268     }
269
270 }