a4853b76aa25fe3638d0b3a529401ff53d7cc96a
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Common / TSVectorUint16Pair.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/VectorUint16Pair")]
13     public class InternalVectorUint16PairTest
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("VectorUint16Pair contructor.")]
32         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.VectorUint16Pair C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("AUTHOR", "guowei.wang@samsung.com")]
36         public void VectorUint16PairContructor()
37         {
38             tlog.Debug(tag, $"VectorUint16PairContructor START");
39
40             var testingTarget = new VectorUint16Pair();
41             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
42             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
43
44             testingTarget.Dispose();
45             tlog.Debug(tag, $"VectorUint16PairContructor END (OK)");
46         }
47
48         [Test]
49         [Category("P1")]
50         [Description("VectorUint16Pair contructor. With VectorUint16Pair.")]
51         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.VectorUint16Pair C")]
52         [Property("SPEC_URL", "-")]
53         [Property("CRITERIA", "CONSTR")]
54         [Property("AUTHOR", "guowei.wang@samsung.com")]
55         public void VectorUint16PairContructorWithVectorUint16Pair()
56         {
57             tlog.Debug(tag, $"VectorUint16PairContructorWithVectorUint16Pair START");
58
59             using (VectorUint16Pair vector = new VectorUint16Pair())
60             {
61                 var testingTarget = new VectorUint16Pair(vector);
62                 Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
63                 Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
64
65                 testingTarget.Dispose();
66             }
67
68             tlog.Debug(tag, $"VectorUint16PairContructorWithVectorUint16Pair END (OK)");
69         }
70
71         [Test]
72         [Category("P1")]
73         [Description("VectorUint16Pair Assign.")]
74         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.Assign M")]
75         [Property("SPEC_URL", "-")]
76         [Property("CRITERIA", "MR")]
77         [Property("AUTHOR", "guowei.wang@samsung.com")]
78         public void VectorUint16PairAssign()
79         {
80             tlog.Debug(tag, $"VectorUint16PairAssign START");
81
82             using (VectorUint16Pair vector = new VectorUint16Pair())
83             {
84                 var testingTarget = vector.Assign(vector);
85                 Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
86                 Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
87
88                 testingTarget.Dispose();
89             }
90
91             tlog.Debug(tag, $"VectorUint16PairAssign END (OK)");
92         }
93
94         [Test]
95         [Category("P1")]
96         [Description("VectorUint16Pair Begin.")]
97         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.Begin M")]
98         [Property("SPEC_URL", "-")]
99         [Property("CRITERIA", "MR")]
100         [Property("AUTHOR", "guowei.wang@samsung.com")]
101         public void VectorUint16PairBegin()
102         {
103             tlog.Debug(tag, $"VectorUint16PairBegin START");
104
105             var testingTarget = new VectorUint16Pair();
106             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
107             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
108
109             var result = testingTarget.Begin();
110             tlog.Debug(tag, "Begin :" + result);
111
112             testingTarget.Dispose();
113             tlog.Debug(tag, $"VectorUint16PairBegin END (OK)");
114         }
115
116         [Test]
117         [Category("P1")]
118         [Description("VectorUint16Pair End.")]
119         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.End M")]
120         [Property("SPEC_URL", "-")]
121         [Property("CRITERIA", "MR")]
122         [Property("AUTHOR", "guowei.wang@samsung.com")]
123         public void VectorUint16PairEnd()
124         {
125             tlog.Debug(tag, $"VectorUint16PairEnd START");
126
127             var testingTarget = new VectorUint16Pair();
128             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
129             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
130
131             var result = testingTarget.End();
132             tlog.Debug(tag, "End :" + result);
133
134             testingTarget.Dispose();
135             tlog.Debug(tag, $"VectorUint16PairEnd END (OK)");
136         }
137
138         [Test]
139         [Category("P1")]
140         [Description("VectorUint16Pair PushBack.")]
141         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.PushBack M")]
142         [Property("SPEC_URL", "-")]
143         [Property("CRITERIA", "MR")]
144         [Property("AUTHOR", "guowei.wang@samsung.com")]
145         public void VectorUint16PushBack()
146         {
147             tlog.Debug(tag, $"VectorUint16PairPushBack START");
148
149             var testingTarget = new VectorUint16Pair();
150             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
151             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
152
153             try
154             {
155                 testingTarget.PushBack(new Uint16Pair());
156                 var result = testingTarget.ValueOfIndex(0);
157                 tlog.Debug(tag, "ValueOfIndex :" + result);
158             }
159             catch (Exception e)
160             {
161                 tlog.Debug(tag, e.Message.ToString());
162                 Assert.Fail("Caught Exception : Failed!");
163             }
164
165             testingTarget.Dispose();
166             tlog.Debug(tag, $"VectorUint16PairPushBack END (OK)");
167         }
168
169         [Test]
170         [Category("P1")]
171         [Description("VectorUint16Pair Insert.")]
172         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.Insert M")]
173         [Property("SPEC_URL", "-")]
174         [Property("CRITERIA", "MR")]
175         [Property("AUTHOR", "guowei.wang@samsung.com")]
176         public void VectorUint16Insert()
177         {
178             tlog.Debug(tag, $"VectorUint16Insert START");
179
180             var testingTarget = new VectorUint16Pair();
181             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
182             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
183
184             try
185             {
186                 testingTarget.Insert(testingTarget.Begin(), new Uint16Pair(30, 40));
187             }
188             catch (Exception e)
189             {
190                 tlog.Debug(tag, e.Message.ToString());
191                 Assert.Fail("Caught Exception : Failed!");
192             }
193
194             testingTarget.Dispose();
195             tlog.Debug(tag, $"VectorUint16Insert END (OK)");
196         }
197
198         [Test]
199         [Category("P1")]
200         [Description("VectorUint16Pair Insert. 3 parameters.")]
201         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.Insert M")]
202         [Property("SPEC_URL", "-")]
203         [Property("CRITERIA", "MR")]
204         [Property("AUTHOR", "guowei.wang@samsung.com")]
205         public void VectorUint16InsertWith3Parameters()
206         {
207             tlog.Debug(tag, $"VectorUint16InsertWith3Parameters START");
208
209             var testingTarget = new VectorUint16Pair();
210             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
211             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
212
213             try
214             {
215                 testingTarget.Insert(new Uint16Pair(0, 0), testingTarget.Begin(), testingTarget.End());
216             }
217             catch (Exception e)
218             {
219                 tlog.Debug(tag, e.Message.ToString());
220                 Assert.Fail("Caught Exception : Failed!");
221             }
222
223             testingTarget.Dispose();
224             tlog.Debug(tag, $"VectorUint16InsertWith3Parameters END (OK)");
225         }
226
227         [Test]
228         [Category("P1")]
229         [Description("VectorUint16Pair Reserve.")]
230         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.Reserve M")]
231         [Property("SPEC_URL", "-")]
232         [Property("CRITERIA", "MR")]
233         [Property("AUTHOR", "guowei.wang@samsung.com")]
234         public void VectorUint16Reserve()
235         {
236             tlog.Debug(tag, $"VectorUint16Reverse START");
237
238             var testingTarget = new VectorUint16Pair();
239             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
240             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
241
242             try
243             {
244                 testingTarget.Reserve(1);
245             }
246             catch (Exception e)
247             {
248                 tlog.Debug(tag, e.Message.ToString());
249                 Assert.Fail("Caught Exception : Failed!");
250             }
251
252             testingTarget.Dispose();
253             tlog.Debug(tag, $"VectorUint16Reserve END (OK)");
254         }
255
256         [Test]
257         [Category("P1")]
258         [Description("VectorUint16Pair Resize.")]
259         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.Resize M")]
260         [Property("SPEC_URL", "-")]
261         [Property("CRITERIA", "MR")]
262         [Property("AUTHOR", "guowei.wang@samsung.com")]
263         public void VectorUint16Resize()
264         {
265             tlog.Debug(tag, $"VectorUint16Resize START");
266
267             var testingTarget = new VectorUint16Pair();
268             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
269             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
270
271             try
272             {
273                 testingTarget.Resize(1);
274             }
275             catch (Exception e)
276             {
277                 tlog.Debug(tag, e.Message.ToString());
278                 Assert.Fail("Caught Exception : Failed!");
279             }
280
281             testingTarget.Dispose();
282             tlog.Debug(tag, $"VectorUint16Resize END (OK)");
283         }
284
285         [Test]
286         [Category("P1")]
287         [Description("VectorUint16Pair Resize. With Uint16Pair.")]
288         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.Resize M")]
289         [Property("SPEC_URL", "-")]
290         [Property("CRITERIA", "MR")]
291         [Property("AUTHOR", "guowei.wang@samsung.com")]
292         public void VectorUint16ResizeWithUint16Pair()
293         {
294             tlog.Debug(tag, $"VectorUint16ResizeWithUint16Pair START");
295
296             var testingTarget = new VectorUint16Pair();
297             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
298             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
299
300             try
301             {
302                 testingTarget.Resize(1, new Uint16Pair());
303             }
304             catch (Exception e)
305             {
306                 tlog.Debug(tag, e.Message.ToString());
307                 Assert.Fail("Caught Exception : Failed!");
308             }
309
310             testingTarget.Dispose();
311             tlog.Debug(tag, $"VectorUint16ResizeWithUint16Pair END (OK)");
312         }
313
314         [Test]
315         [Category("P1")]
316         [Description("VectorUint16Pair Erase.")]
317         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.Erase M")]
318         [Property("SPEC_URL", "-")]
319         [Property("CRITERIA", "MR")]
320         [Property("AUTHOR", "guowei.wang@samsung.com")]
321         public void VectorUint16Erase()
322         {
323             tlog.Debug(tag, $"VectorUint16Erase START");
324
325             var testingTarget = new VectorUint16Pair();
326             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
327             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
328
329             try
330             {
331                 testingTarget.Erase(new Uint16Pair());
332             }
333             catch (Exception e)
334             {
335                 tlog.Debug(tag, e.Message.ToString());
336                 Assert.Fail("Caught Exception : Failed!");
337             }
338
339             testingTarget.Dispose();
340             tlog.Debug(tag, $"VectorUint16Erase END (OK)");
341         }
342
343         [Test]
344         [Category("P1")]
345         [Description("VectorUint16Pair Erase. With 2 Uint16Pair.")]
346         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.Erase M")]
347         [Property("SPEC_URL", "-")]
348         [Property("CRITERIA", "MR")]
349         [Property("AUTHOR", "guowei.wang@samsung.com")]
350         public void VectorUint16EraseWith2Uint16Pair()
351         {
352             tlog.Debug(tag, $"VectorUint16EraseWith2Uint16Pair START");
353
354             var testingTarget = new VectorUint16Pair();
355             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
356             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
357
358             try
359             {
360                 testingTarget.Erase(new Uint16Pair(), new Uint16Pair());
361             }
362             catch (Exception e)
363             {
364                 tlog.Debug(tag, e.Message.ToString());
365                 Assert.Fail("Caught Exception : Failed!");
366             }
367
368             testingTarget.Dispose();
369             tlog.Debug(tag, $"VectorUint16EraseWith2Uint16Pair END (OK)");
370         }
371
372         [Test]
373         [Category("P1")]
374         [Description("VectorUint16Pair Remove.")]
375         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.Remove M")]
376         [Property("SPEC_URL", "-")]
377         [Property("CRITERIA", "MR")]
378         [Property("AUTHOR", "guowei.wang@samsung.com")]
379         public void VectorUint16Remove()
380         {
381             tlog.Debug(tag, $"VectorUint16Remove START");
382
383             var testingTarget = new VectorUint16Pair();
384             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
385             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
386
387             try
388             {
389                 using (Uint16Pair pair = new Uint16Pair(30, 40))
390                 {
391                     testingTarget.PushBack(pair);
392                     testingTarget.Remove(pair);
393                 }
394             }
395             catch (Exception e)
396             {
397                 tlog.Debug(tag, e.Message.ToString());
398                 Assert.Fail("Caught Exception : Failed!");
399             }
400
401             testingTarget.Dispose();
402             tlog.Debug(tag, $"VectorUint16Remove END (OK)");
403         }
404
405         [Test]
406         [Category("P1")]
407         [Description("VectorUint16Pair Swap.")]
408         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.Swap M")]
409         [Property("SPEC_URL", "-")]
410         [Property("CRITERIA", "MR")]
411         [Property("AUTHOR", "guowei.wang@samsung.com")]
412         public void VectorUint16Swap()
413         {
414             tlog.Debug(tag, $"VectorUint16Swap START");
415
416             var testingTarget = new VectorUint16Pair();
417             Assert.IsNotNull(testingTarget, "Can't create success object VectorUint16Pair.");
418             Assert.IsInstanceOf<VectorUint16Pair>(testingTarget, "Should return VectorUint16Pair instance.");
419
420             try
421             {
422                 using (VectorUint16Pair vector = new VectorUint16Pair())
423                 {
424                     testingTarget.Swap(vector);
425                 }
426             }
427             catch (Exception e)
428             {
429                 tlog.Debug(tag, e.Message.ToString());
430                 Assert.Fail("Caught Exception : Failed!");
431             }
432
433             testingTarget.Clear();
434             testingTarget.Release();
435             tlog.Debug(tag, $"VectorUint16Swap END (OK)");
436         }
437
438         [Test]
439         [Category("P1")]
440         [Description("VectorUint16Pair BaseType.")]
441         [Property("SPEC", "Tizen.NUI.VectorUint16Pair.BaseType A")]
442         [Property("SPEC_URL", "-")]
443         [Property("CRITERIA", "PRO")]
444         [Property("AUTHOR", "guowei.wang@samsung.com")]
445         public void VectorUint16BaseType()
446         {
447             tlog.Debug(tag, $"VectorUint16BaseType START");
448
449             try
450             {
451                 var result = VectorUint16Pair.BaseType;
452                 tlog.Debug(tag, "BaseType : " + result);
453             }
454             catch (Exception e)
455             {
456                 tlog.Debug(tag, e.Message.ToString());
457                 Assert.Fail("Caught Exception : Failed!");
458             }
459
460             tlog.Debug(tag, $"VectorUint16BaseType END (OK)");
461         }
462     }
463 }