Merge remote-tracking branch 'origin/master' into tizen
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / internal / Common / TSVectorBase.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/VectorBase")]
13     public class InternalVectorBaseTest
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("VectorBase constructor.")]
32         [Property("SPEC", "Tizen.NUI.VectorBase.VectorBase C")]
33         [Property("SPEC_URL", "-")]
34         [Property("CRITERIA", "CONSTR")]
35         [Property("AUTHOR", "guowei.wang@samsung.com")]
36         public void VectorBaseConstructor()
37         {
38             tlog.Debug(tag, $"VectorBaseConstructor START");
39
40             using (View view = new View())
41             {
42                 var testingTarget = new VectorBase(view.SwigCPtr.Handle, false);
43                 Assert.IsNotNull(testingTarget, "Should be not null!");
44                 Assert.IsInstanceOf<VectorBase>(testingTarget, "Should be an Instance of VectorBase!");
45
46                 testingTarget.Dispose();
47             }
48
49             tlog.Debug(tag, $"VectorBaseConstructor END (OK)");
50         }
51
52         [Test]
53         [Category("P1")]
54         [Description("VectorBase Capacity.")]
55         [Property("SPEC", "Tizen.NUI.VectorBase.Capacity M")]
56         [Property("SPEC_URL", "-")]
57         [Property("CRITERIA", "MR")]
58         [Property("AUTHOR", "guowei.wang@samsung.com")]
59         public void VectorBaseCapacity()
60         {
61             tlog.Debug(tag, $"VectorBaseCapacity START");
62
63             using (View view = new View())
64             {
65                 var testingTarget = new VectorBase(view.SwigCPtr.Handle, false);
66                 Assert.IsNotNull(testingTarget, "Should be not null!");
67                 Assert.IsInstanceOf<VectorBase>(testingTarget, "Should be an Instance of VectorBase!");
68
69                 try
70                 {
71                     var result = testingTarget.Capacity();
72                     tlog.Debug(tag, "Capacity : " + result);
73                 }
74                 catch (Exception e)
75                 {
76                     tlog.Debug(tag, e.Message.ToString());
77                     Assert.Fail("Caught Exception: Failed!");
78                 }
79
80                 testingTarget.Dispose();
81             }
82
83             tlog.Debug(tag, $"VectorBaseCapacity END (OK)");
84         }
85
86         [Test]
87         [Category("P1")]
88         [Description("VectorBase Count.")]
89         [Property("SPEC", "Tizen.NUI.VectorBase.Count M")]
90         [Property("SPEC_URL", "-")]
91         [Property("CRITERIA", "MR")]
92         [Property("AUTHOR", "guowei.wang@samsung.com")]
93         public void VectorBaseCount()
94         {
95             tlog.Debug(tag, $"VectorBaseCount START");
96
97             using (View view = new View())
98             {
99                 var testingTarget = new VectorBase(view.SwigCPtr.Handle, false);
100                 Assert.IsNotNull(testingTarget, "Should be not null!");
101                 Assert.IsInstanceOf<VectorBase>(testingTarget, "Should be an Instance of VectorBase!");
102
103                 try
104                 {
105                     var result = testingTarget.Count();
106                     tlog.Debug(tag, "Count : " + result);
107                 }
108                 catch (Exception e)
109                 {
110                     tlog.Debug(tag, e.Message.ToString());
111                     Assert.Fail("Caught Exception: Failed!");
112                 }
113
114                 testingTarget.Dispose();
115             }
116
117             tlog.Debug(tag, $"VectorBaseCount END (OK)");
118         }
119
120         [Test]
121         [Category("P1")]
122         [Description("VectorBase Size.")]
123         [Property("SPEC", "Tizen.NUI.VectorBase.Size M")]
124         [Property("SPEC_URL", "-")]
125         [Property("CRITERIA", "MR")]
126         [Property("AUTHOR", "guowei.wang@samsung.com")]
127         public void VectorBaseSize()
128         {
129             tlog.Debug(tag, $"VectorBaseSize START");
130
131             using (View view = new View())
132             {
133                 var testingTarget = new VectorBase(view.SwigCPtr.Handle, false);
134                 Assert.IsNotNull(testingTarget, "Should be not null!");
135                 Assert.IsInstanceOf<VectorBase>(testingTarget, "Should be an Instance of VectorBase!");
136
137                 try
138                 {
139                     var result = testingTarget.Size();
140                     tlog.Debug(tag, "Size : " + result);
141                 }
142                 catch (Exception e)
143                 {
144                     tlog.Debug(tag, e.Message.ToString());
145                     Assert.Fail("Caught Exception: Failed!");
146                 }
147
148                 testingTarget.Dispose();
149             }
150
151             tlog.Debug(tag, $"VectorBaseSize END (OK)");
152         }
153
154         [Test]
155         [Category("P1")]
156         [Description("VectorBase Empty.")]
157         [Property("SPEC", "Tizen.NUI.VectorBase.Empty M")]
158         [Property("SPEC_URL", "-")]
159         [Property("CRITERIA", "MR")]
160         [Property("AUTHOR", "guowei.wang@samsung.com")]
161         public void VectorBaseEmpty()
162         {
163             tlog.Debug(tag, $"VectorBaseEmpty START");
164
165             using (View view = new View())
166             {
167                 var testingTarget = new VectorBase(view.SwigCPtr.Handle, false);
168                 Assert.IsNotNull(testingTarget, "Should be not null!");
169                 Assert.IsInstanceOf<VectorBase>(testingTarget, "Should be an Instance of VectorBase!");
170
171                 try
172                 {
173                     var result = testingTarget.Empty();
174                     tlog.Debug(tag, "Empty : " + result);
175                 }
176                 catch (Exception e)
177                 {
178                     tlog.Debug(tag, e.Message.ToString());
179                     Assert.Fail("Caught Exception: Failed!");
180                 }
181
182                 testingTarget.Dispose();
183             }
184
185             tlog.Debug(tag, $"VectorBaseEmpty END (OK)");
186         }
187     }
188 }