[NUI] Update NUI.Devel to fix block and crash issues.
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Common / TSUint16Pair.cs
1 using global::System;
2 using NUnit.Framework;
3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6
7 namespace Tizen.NUI.Devel.Tests
8 {
9     using tlog = Tizen.Log;
10
11     [TestFixture]
12     [Description("internal/Common/Uint16Pair")]
13     public class InternalUint16PairTest
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("Uint16Pair constructor.")]
32         [Property("SPEC", "Tizen.NUI.Uint16Pair.Uint16Pair C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("AUTHOR", "guowei.wang@samsung.com")]
36         public void Uint16PairConstructor()
37         {
38             tlog.Debug(tag, $"Uint16PairConstructor START");
39
40             using (Uint16Pair data = new Uint16Pair(1, 2))
41             {
42                 var testingTarget = new Uint16Pair(data);
43                 Assert.IsNotNull(testingTarget, "Can't create success object Uint16Pair");
44                 Assert.IsInstanceOf<Uint16Pair>(testingTarget, "Should be an instance of Uint16Pair type.");
45
46                 testingTarget.Dispose();
47             }
48
49             tlog.Debug(tag, $"Uint16PairConstructor END (OK)");
50         }
51
52         [Test]
53         [Category("P1")]
54         [Description("Uint16Pair SetWidth.")]
55         [Property("SPEC", "Tizen.NUI.Uint16Pair.SetWidth M")]
56         [Property("SPEC_URL", "-")]
57         [Property("CRITERIA", "MR")]
58         [Property("AUTHOR", "guowei.wang@samsung.com")]
59         public void Uint16PairSetWidth()
60         {
61             tlog.Debug(tag, $"Uint16PairSetWidth START");
62
63             var testingTarget = new Uint16Pair(1, 2);
64             Assert.IsNotNull(testingTarget, "Can't create success object Uint16Pair");
65             Assert.IsInstanceOf<Uint16Pair>(testingTarget, "Should be an instance of Uint16Pair type.");
66
67             try
68             {
69                 testingTarget.SetWidth(2);
70             }
71             catch (Exception e)
72             {
73                 tlog.Debug(tag, e.Message.ToString());
74                 Assert.Fail("Caught Exception : Failed!");
75             }
76
77             testingTarget.Dispose();
78
79             tlog.Debug(tag, $"Uint16PairSetWidth END (OK)");
80         }
81
82         [Test]
83         [Category("P1")]
84         [Description("Uint16Pair SetHeight.")]
85         [Property("SPEC", "Tizen.NUI.Uint16Pair.SetHeight M")]
86         [Property("SPEC_URL", "-")]
87         [Property("CRITERIA", "MR")]
88         [Property("AUTHOR", "guowei.wang@samsung.com")]
89         public void Uint16PairSetHeight()
90         {
91             tlog.Debug(tag, $"Uint16PairSetHeight START");
92
93             var testingTarget = new Uint16Pair(1, 2);
94             Assert.IsNotNull(testingTarget, "Can't create success object Uint16Pair");
95             Assert.IsInstanceOf<Uint16Pair>(testingTarget, "Should be an instance of Uint16Pair type.");
96
97             try
98             {
99                 testingTarget.SetHeight(1);
100             }
101             catch (Exception e)
102             {
103                 tlog.Debug(tag, e.Message.ToString());
104                 Assert.Fail("Caught Exception : Failed!");
105             }
106
107             testingTarget.Dispose();
108
109             tlog.Debug(tag, $"Uint16PairSetHeight END (OK)");
110         }
111
112         [Test]
113         [Category("P1")]
114         [Description("Uint16Pair SetX.")]
115         [Property("SPEC", "Tizen.NUI.Uint16Pair.SetX M")]
116         [Property("SPEC_URL", "-")]
117         [Property("CRITERIA", "MR")]
118         [Property("AUTHOR", "guowei.wang@samsung.com")]
119         public void Uint16PairSetX()
120         {
121             tlog.Debug(tag, $"Uint16PairSetX START");
122
123             var testingTarget = new Uint16Pair(1, 2);
124             Assert.IsNotNull(testingTarget, "Can't create success object Uint16Pair");
125             Assert.IsInstanceOf<Uint16Pair>(testingTarget, "Should be an instance of Uint16Pair type.");
126
127             try
128             {
129                 testingTarget.SetX(2);
130             }
131             catch (Exception e)
132             {
133                 tlog.Debug(tag, e.Message.ToString());
134                 Assert.Fail("Caught Exception : Failed!");
135             }
136
137             testingTarget.Dispose();
138
139             tlog.Debug(tag, $"Uint16PairSetX END (OK)");
140         }
141
142         [Test]
143         [Category("P1")]
144         [Description("Uint16Pair SetY.")]
145         [Property("SPEC", "Tizen.NUI.Uint16Pair.SetY M")]
146         [Property("SPEC_URL", "-")]
147         [Property("CRITERIA", "MR")]
148         [Property("AUTHOR", "guowei.wang@samsung.com")]
149         public void Uint16PairSetY()
150         {
151             tlog.Debug(tag, $"Uint16PairSetY START");
152
153             var testingTarget = new Uint16Pair(1, 2);
154             Assert.IsNotNull(testingTarget, "Can't create success object Uint16Pair");
155             Assert.IsInstanceOf<Uint16Pair>(testingTarget, "Should be an instance of Uint16Pair type.");
156
157             try
158             {
159                 testingTarget.SetY(2);
160             }
161             catch (Exception e)
162             {
163                 tlog.Debug(tag, e.Message.ToString());
164                 Assert.Fail("Caught Exception : Failed!");
165             }
166
167             testingTarget.Dispose();
168
169             tlog.Debug(tag, $"Uint16PairSetY END (OK)");
170         }
171
172         [Test]
173         [Category("P1")]
174         [Description("Uint16Pair Assign.")]
175         [Property("SPEC", "Tizen.NUI.Uint16Pair.Assign M")]
176         [Property("SPEC_URL", "-")]
177         [Property("CRITERIA", "MR")]
178         [Property("AUTHOR", "guowei.wang@samsung.com")]
179         public void Uint16PairAssign()
180         {
181             tlog.Debug(tag, $"Uint16PairAssign START");
182
183             using (Uint16Pair data = new Uint16Pair(1, 2))
184             {
185                 var testingTarget = data.Assign(data);
186                 Assert.IsNotNull(testingTarget, "Can't create success object Uint16Pair");
187                 Assert.IsInstanceOf<Uint16Pair>(testingTarget, "Should be an instance of Uint16Pair type.");
188
189                 testingTarget.Dispose();
190             }
191
192             tlog.Debug(tag, $"Uint16PairAssign END (OK)");
193         }
194
195         [Test]
196         [Category("P1")]
197         [Description("Uint16Pair <.")]
198         [Property("SPEC", "Tizen.NUI.Uint16Pair.LessThan M")]
199         [Property("SPEC_URL", "-")]
200         [Property("CRITERIA", "MR")]
201         [Property("AUTHOR", "guowei.wang@samsung.com")]
202         public void Uint16PairLessThan()
203         {
204             tlog.Debug(tag, $"Uint16PairLessThan START");
205
206             var testingTarget = new Uint16Pair(1, 2);
207             Assert.IsNotNull(testingTarget, "Can't create success object Uint16Pair");
208             Assert.IsInstanceOf<Uint16Pair>(testingTarget, "Should be an instance of Uint16Pair type.");
209
210             using (Uint16Pair obj = new Uint16Pair(1, 0))
211             {
212                 var result = testingTarget < obj;
213                 tlog.Debug(tag, result.ToString());
214             }
215
216             testingTarget.Dispose();
217             tlog.Debug(tag, $"Uint16PairLessThan END (OK)");
218         }
219
220         [Test]
221         [Category("P1")]
222         [Description("Uint16Pair >.")]
223         [Property("SPEC", "Tizen.NUI.Uint16Pair.LessThan M")]
224         [Property("SPEC_URL", "-")]
225         [Property("CRITERIA", "MR")]
226         [Property("AUTHOR", "guowei.wang@samsung.com")]
227         public void Uint16PairGreaterThan()
228         {
229             tlog.Debug(tag, $"Uint16PairGreaterThan START");
230
231             var testingTarget = new Uint16Pair(1, 2);
232             Assert.IsNotNull(testingTarget, "Can't create success object Uint16Pair");
233             Assert.IsInstanceOf<Uint16Pair>(testingTarget, "Should be an instance of Uint16Pair type.");
234
235             using (Uint16Pair obj = new Uint16Pair(1, 0))
236             {
237                 var result = testingTarget > obj;
238                 tlog.Debug(tag, result.ToString());
239             }
240
241             testingTarget.Dispose();
242             tlog.Debug(tag, $"Uint16PairGreaterThan END (OK)");
243         }
244     }
245 }