3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("internal/Common/VectorUnsignedChar")]
13 public class InternalVectorUnsignedCharTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("VectorUnsignedChar contructor.")]
32 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.VectorUnsignedChar C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void VectorUnsignedCharContructor()
38 tlog.Debug(tag, $"VectorUnsignedCharContructor START");
40 var testingTarget = new VectorUnsignedChar();
41 Assert.IsNotNull(testingTarget, "Can't create success object VectorUnsignedChar.");
42 Assert.IsInstanceOf<VectorUnsignedChar>(testingTarget, "Should return VectorUnsignedChar instance.");
44 testingTarget.Dispose();
45 tlog.Debug(tag, $"VectorUnsignedCharContructor END (OK)");
50 [Description("VectorUnsignedChar contructor. With VectorUnsignedChar.")]
51 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.VectorUnsignedChar C")]
52 [Property("SPEC_URL", "-")]
53 [Property("CRITERIA", "CONSTR")]
54 [Property("AUTHOR", "guowei.wang@samsung.com")]
55 public void VectorUnsignedCharContructorWithVectorUnsignedChar()
57 tlog.Debug(tag, $"VectorUnsignedCharContructorWithVectorUnsignedChar START");
59 using (VectorUnsignedChar vector = new VectorUnsignedChar())
61 var testingTarget = new VectorUnsignedChar(vector);
62 Assert.IsNotNull(testingTarget, "Can't create success object VectorUnsignedChar.");
63 Assert.IsInstanceOf<VectorUnsignedChar>(testingTarget, "Should return VectorUnsignedChar instance.");
65 testingTarget.Dispose();
68 tlog.Debug(tag, $"VectorUnsignedCharContructorWithVectorUnsignedChar END (OK)");
73 [Description("VectorUnsignedChar Assign.")]
74 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.Assign M")]
75 [Property("SPEC_URL", "-")]
76 [Property("CRITERIA", "MR")]
77 [Property("AUTHOR", "guowei.wang@samsung.com")]
78 public void VectorUnsignedCharAssign()
80 tlog.Debug(tag, $"VectorUnsignedCharAssign START");
82 using (VectorUnsignedChar vector = new VectorUnsignedChar())
84 var testingTarget = vector.Assign(vector);
85 Assert.IsNotNull(testingTarget, "Can't create success object VectorUnsignedChar.");
86 Assert.IsInstanceOf<VectorUnsignedChar>(testingTarget, "Should return VectorUnsignedChar instance.");
88 testingTarget.Dispose();
91 tlog.Debug(tag, $"VectorUnsignedCharAssign END (OK)");
96 [Description("VectorUnsignedChar Begin.")]
97 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.Begin M")]
98 [Property("SPEC_URL", "-")]
99 [Property("CRITERIA", "MR")]
100 [Property("AUTHOR", "guowei.wang@samsung.com")]
101 public void VectorUnsignedCharBegin()
103 tlog.Debug(tag, $"VectorUnsignedCharBegin START");
105 var testingTarget = new VectorUnsignedChar();
106 Assert.IsNotNull(testingTarget, "Can't create success object VectorUnsignedChar.");
107 Assert.IsInstanceOf<VectorUnsignedChar>(testingTarget, "Should return VectorUnsignedChar instance.");
111 testingTarget.Begin();
115 tlog.Debug(tag, e.Message.ToString());
116 Assert.Fail("Caught Exception : Failed!");
119 testingTarget.Dispose();
120 tlog.Debug(tag, $"VectorUnsignedCharBegin END (OK)");
125 [Description("VectorUnsignedChar End.")]
126 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.End M")]
127 [Property("SPEC_URL", "-")]
128 [Property("CRITERIA", "MR")]
129 [Property("AUTHOR", "guowei.wang@samsung.com")]
130 public void VectorUnsignedCharEnd()
132 tlog.Debug(tag, $"VectorUnsignedCharEnd START");
134 var testingTarget = new VectorUnsignedChar();
135 Assert.IsNotNull(testingTarget, "Can't create success object VectorUnsignedChar.");
136 Assert.IsInstanceOf<VectorUnsignedChar>(testingTarget, "Should return VectorUnsignedChar instance.");
144 tlog.Debug(tag, e.Message.ToString());
145 Assert.Fail("Caught Exception : Failed!");
148 testingTarget.Dispose();
149 tlog.Debug(tag, $"VectorUnsignedCharEnd END (OK)");
154 [Description("VectorUnsignedChar PushBack.")]
155 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.PushBack M")]
156 [Property("SPEC_URL", "-")]
157 [Property("CRITERIA", "MR")]
158 [Property("AUTHOR", "guowei.wang@samsung.com")]
159 public void VectorUnsignedCharPushBack()
161 tlog.Debug(tag, $"VectorUnsignedCharPushBack START");
163 var testingTarget = new VectorUnsignedChar();
164 Assert.IsNotNull(testingTarget, "Can't create success object VectorUnsignedChar.");
165 Assert.IsInstanceOf<VectorUnsignedChar>(testingTarget, "Should return VectorUnsignedChar instance.");
169 testingTarget.PushBack(255);
170 var result = testingTarget.ValueOfIndex(0);
171 tlog.Debug(tag, "ValueOfIndex(0) : " + result);
175 tlog.Debug(tag, e.Message.ToString());
176 Assert.Fail("Caught Exception : Failed!");
179 testingTarget.Dispose();
180 tlog.Debug(tag, $"VectorUnsignedCharPushBack END (OK)");
185 [Description("VectorUnsignedChar Reserve.")]
186 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.Reserve M")]
187 [Property("SPEC_URL", "-")]
188 [Property("CRITERIA", "MR")]
189 [Property("AUTHOR", "guowei.wang@samsung.com")]
190 public void VectorUnsignedCharReserve()
192 tlog.Debug(tag, $"VectorUnsignedCharReserve START");
194 var testingTarget = new VectorUnsignedChar();
195 Assert.IsNotNull(testingTarget, "Can't create success object VectorUnsignedChar.");
196 Assert.IsInstanceOf<VectorUnsignedChar>(testingTarget, "Should return VectorUnsignedChar instance.");
200 testingTarget.PushBack(255);
201 testingTarget.Reserve(1);
205 tlog.Debug(tag, e.Message.ToString());
206 Assert.Fail("Caught Exception : Failed!");
209 testingTarget.Dispose();
210 tlog.Debug(tag, $"VectorUnsignedCharReserve END (OK)");
215 [Description("VectorUnsignedChar Resize.")]
216 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.Resize M")]
217 [Property("SPEC_URL", "-")]
218 [Property("CRITERIA", "MR")]
219 [Property("AUTHOR", "guowei.wang@samsung.com")]
220 public void VectorUnsignedCharResize()
222 tlog.Debug(tag, $"VectorUnsignedCharResize START");
224 var testingTarget = new VectorUnsignedChar();
225 Assert.IsNotNull(testingTarget, "Can't create success object VectorUnsignedChar.");
226 Assert.IsInstanceOf<VectorUnsignedChar>(testingTarget, "Should return VectorUnsignedChar instance.");
230 testingTarget.PushBack(255);
231 /** 1 parameter : uint count */
232 testingTarget.Resize(1);
233 /** 2 parameters : uint count, byte item */
234 testingTarget.Resize(1, 111);
238 tlog.Debug(tag, e.Message.ToString());
239 Assert.Fail("Caught Exception : Failed!");
242 testingTarget.Dispose();
243 tlog.Debug(tag, $"VectorUnsignedCharResize END (OK)");
248 [Description("VectorUnsignedChar Erase.")]
249 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.Erase M")]
250 [Property("SPEC_URL", "-")]
251 [Property("CRITERIA", "MR")]
252 [Property("AUTHOR", "guowei.wang@samsung.com")]
253 public void VectorUnsignedCharErase()
255 tlog.Debug(tag, $"VectorUnsignedCharErase START");
257 var testingTarget = new VectorUnsignedChar();
258 Assert.IsNotNull(testingTarget, "Can't create success object VectorUnsignedChar.");
259 Assert.IsInstanceOf<VectorUnsignedChar>(testingTarget, "Should return VectorUnsignedChar instance.");
263 testingTarget.PushBack(255);
264 byte[] arr = new byte[4];
266 /** 1 parameter : byte[] iterator */
267 testingTarget.Erase(arr);
268 /** 2 parameters : byte[] first, SWIGTYPE_p_unsigned_char last */
269 testingTarget.Erase(arr, testingTarget.End());
273 tlog.Debug(tag, e.Message.ToString());
274 Assert.Fail("Caught Exception : Failed!");
277 testingTarget.Dispose();
278 tlog.Debug(tag, $"VectorUnsignedCharErase END (OK)");
283 [Description("VectorUnsignedChar Remove.")]
284 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.Remove M")]
285 [Property("SPEC_URL", "-")]
286 [Property("CRITERIA", "MR")]
287 [Property("AUTHOR", "guowei.wang@samsung.com")]
288 public void VectorUnsignedCharRemove()
290 tlog.Debug(tag, $"VectorUnsignedCharRemove START");
292 var testingTarget = new VectorUnsignedChar();
293 Assert.IsNotNull(testingTarget, "Can't create success object VectorUnsignedChar.");
294 Assert.IsInstanceOf<VectorUnsignedChar>(testingTarget, "Should return VectorUnsignedChar instance.");
298 testingTarget.PushBack(255);
299 byte[] arr = new byte[4];
300 testingTarget.Remove(arr);
304 tlog.Debug(tag, e.Message.ToString());
305 Assert.Fail("Caught Exception : Failed!");
308 testingTarget.Dispose();
309 tlog.Debug(tag, $"VectorUnsignedCharRemove END (OK)");
314 [Description("VectorUnsignedChar Swap.")]
315 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.Swap M")]
316 [Property("SPEC_URL", "-")]
317 [Property("CRITERIA", "MR")]
318 [Property("AUTHOR", "guowei.wang@samsung.com")]
319 public void VectorUnsignedCharSwap()
321 tlog.Debug(tag, $"VectorUnsignedCharSwap START");
323 var testingTarget = new VectorUnsignedChar();
324 Assert.IsNotNull(testingTarget, "Can't create success object VectorUnsignedChar.");
325 Assert.IsInstanceOf<VectorUnsignedChar>(testingTarget, "Should return VectorUnsignedChar instance.");
329 using (VectorUnsignedChar vector = new VectorUnsignedChar())
331 testingTarget.Swap(vector);
336 tlog.Debug(tag, e.Message.ToString());
337 Assert.Fail("Caught Exception : Failed!");
340 testingTarget.Clear();
341 testingTarget.Release();
342 tlog.Debug(tag, $"VectorUnsignedCharSwap END (OK)");
347 [Description("VectorUnsignedChar BaseType.")]
348 [Property("SPEC", "Tizen.NUI.VectorUnsignedChar.BaseType A")]
349 [Property("SPEC_URL", "-")]
350 [Property("CRITERIA", "PRO")]
351 [Property("AUTHOR", "guowei.wang@samsung.com")]
352 public void VectorUnsignedCharBaseType()
354 tlog.Debug(tag, $"VectorUnsignedCharBaseType START");
358 var result = VectorUnsignedChar.BaseType;
359 tlog.Debug(tag, "BaseType : " + result);
363 tlog.Debug(tag, e.Message.ToString());
364 Assert.Fail("Caught Exception : Failed!");
367 tlog.Debug(tag, $"VectorUnsignedCharBaseType END (OK)");