60f8a52b5baa7f3e41986a346df16221d85146a9
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / testcase / public / Common / TSVector3.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 using System.Collections.Generic;
7 using System.Threading.Tasks;
8
9 namespace Tizen.NUI.Devel.Tests
10 {
11     using tlog = Tizen.Log;
12
13     [TestFixture]
14     [Description("public/Common/Vector3")]
15     public class PublicVector3Test
16     {
17         private const string tag = "NUITEST";
18
19         [SetUp]
20         public void Init()
21         {
22             tlog.Info(tag, "Init() is called!");
23         }
24
25         [TearDown]
26         public void Destroy()
27         {
28             tlog.Info(tag, "Destroy() is called!");
29         }
30
31         [Test]
32         [Category("P1")]
33         [Description("Vector3 constructor.")]
34         [Property("SPEC", "Tizen.NUI.Vector3.Vector3 C")]
35         [Property("SPEC_URL", "-")]
36         [Property("CRITERIA", "CONSTR")]
37         [Property("AUTHOR", "guowei.wang@samsung.com")]
38         public void Vector3Constructor()
39         {
40             tlog.Debug(tag, $"Vector3Constructor START");
41
42             var testingTarget = new Vector3();
43             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
44             Assert.IsInstanceOf<Vector3>(testingTarget, "Should return Vector3 instance.");
45
46             testingTarget.Dispose();
47             tlog.Debug(tag, $"Vector3Constructor END (OK)");
48         }
49
50         [Test]
51         [Category("P1")]
52         [Description("Vector3 constructor. With Float.")]
53         [Property("SPEC", "Tizen.NUI.Vector3.Vector3 C")]
54         [Property("SPEC_URL", "-")]
55         [Property("CRITERIA", "CONSTR")]
56         [Property("COVPARAM", "Single, Single, Single")]
57         [Property("AUTHOR", "guowei.wang@samsung.com")]
58         public void Vector3ConstructorWithFloat()
59         {
60             tlog.Debug(tag, $"Vector3ConstructorWithFloat START");
61
62             var testingTarget = new Vector3(100.0f, 200.0f, 300.0f);
63             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
64             Assert.IsInstanceOf<Vector3>(testingTarget, "Should return Vector3 instance.");
65
66             Assert.AreEqual(100.0f, testingTarget.X, "Retrieved vector.X should be equal to set value");
67             Assert.AreEqual(200.0f, testingTarget.Y, "Retrieved vector.Y should be equal to set value");
68             Assert.AreEqual(300.0f, testingTarget.Z, "Retrieved vector.Z should be equal to set value");
69
70             testingTarget.Dispose();
71             tlog.Debug(tag, $"Vector3ConstructorWithFloat END (OK)");
72         }
73
74         [Test]
75         [Category("P1")]
76         [Description("Vector3 constructor. With array.")]
77         [Property("SPEC", "Tizen.NUI.Vector3.Vector3 C")]
78         [Property("SPEC_URL", "-")]
79         [Property("CRITERIA", "CONSTR")]
80         [Property("COVPARAM", "Single[]")]
81         [Property("AUTHOR", "guowei.wang@samsung.com")]
82         public void Vector3ConstructorWithArray()
83         {
84             tlog.Debug(tag, $"Vector3ConstructorWithArray START");
85
86             float[] array = new float[3] { 100.0f, 200.0f, 300.0f };
87
88             var testingTarget = new Vector3(array);
89             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
90             Assert.IsInstanceOf<Vector3>(testingTarget, "Should return Vector3 instance.");
91             
92             Assert.AreEqual(100.0f, testingTarget.X, "Retrieved vector.X should be equal to set value");
93             Assert.AreEqual(200.0f, testingTarget.Y, "Retrieved vector.Y should be equal to set value");
94             Assert.AreEqual(300.0f, testingTarget.Z, "Retrieved vector.Z should be equal to set value");
95
96             testingTarget.Dispose();
97             tlog.Debug(tag, $"Vector3ConstructorWithArray END (OK)");
98         }
99
100         [Test]
101         [Category("P1")]
102         [Description("Vector3 constructor. With Vector2.")]
103         [Property("SPEC", "Tizen.NUI.Vector3.Vector3 C")]
104         [Property("SPEC_URL", "-")]
105         [Property("CRITERIA", "CONSTR")]
106         [Property("COVPARAM", "Vector2")]
107         [Property("AUTHOR", "guowei.wang@samsung.com")]
108         public void Vector3ConstructorWithVector2()
109         {
110             tlog.Debug(tag, $"Vector3ConstructorWithVector2 START");
111
112             using (Vector2 vec2 = new Vector2(100.0f, 200.0f))
113             {
114                 var testingTarget = new Vector3(vec2);
115                 Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
116                 Assert.IsInstanceOf<Vector3>(testingTarget, "Should return Vector3 instance.");
117
118                 Assert.AreEqual(100.0f, testingTarget.X, "Retrieved vector.X should be equal to set value");
119                 Assert.AreEqual(200.0f, testingTarget.Y, "Retrieved vector.Y should be equal to set value");
120                 Assert.AreEqual(0.0f, testingTarget.Z, "Retrieved vector.Z should be equal to set value");
121
122                 testingTarget.Dispose();
123             }
124
125             tlog.Debug(tag, $"Vector3ConstructorWithVector2 END (OK)");
126         }
127
128         [Test]
129         [Category("P1")]
130         [Description("Vector3 constructor. With Vector4.")]
131         [Property("SPEC", "Tizen.NUI.Vector3.Vector3 C")]
132         [Property("SPEC_URL", "-")]
133         [Property("CRITERIA", "CONSTR")]
134         [Property("COVPARAM", "Vector4")]
135         [Property("AUTHOR", "guowei.wang@samsung.com")]
136         public void Vector3ConstructorWithVector4()
137         {
138             tlog.Debug(tag, $"Vector3ConstructorWithVector4 START");
139
140             using (Vector4 vec4 = new Vector4(100.0f, 200.0f, 300.0f, 400.0f))
141             {
142                 var testingTarget = new Vector3(vec4);
143                 Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
144                 Assert.IsInstanceOf<Vector3>(testingTarget, "Should return Vector3 instance.");
145
146                 Assert.AreEqual(100.0f, testingTarget.X, "Retrieved vector.X should be equal to set value");
147                 Assert.AreEqual(200.0f, testingTarget.Y, "Retrieved vector.Y should be equal to set value");
148                 Assert.AreEqual(300.0f, testingTarget.Z, "Retrieved vector.Z should be equal to set value");
149
150                 testingTarget.Dispose();
151             }
152                 
153             tlog.Debug(tag, $"Vector3ConstructorWithVector4 END (OK)");
154         }
155
156         [Test]
157         [Category("P1")]
158         [Description("Vector3 this[uint index].")]
159         [Property("SPEC", "Tizen.NUI.Vector3.this[uint] A")]
160         [Property("SPEC_URL", "-")]
161         [Property("CRITERIA", "PRO")]
162         [Property("AUTHOR", "guowei.wang@samsung.com")]
163         public void Vector3GetVauleBySubscriptIndex()
164         {
165             tlog.Debug(tag, $"Vector3GetVauleBySubscriptIndex START");
166
167             var testingTarget = new Vector3(100.0f, 200.0f, 300.0f);
168             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
169             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
170
171             Assert.AreEqual(100.0f, testingTarget[0], "The value of index[0] is not correct!");
172             Assert.AreEqual(200.0f, testingTarget[1], "The value of index[1] is not correct!");
173             Assert.AreEqual(300.0f, testingTarget[2], "The value of index[2] is not correct!");
174
175             testingTarget.Dispose();
176             tlog.Debug(tag, $"Vector3GetVauleBySubscriptIndex END (OK)");
177         }
178
179         [Test]
180         [Category("P1")]
181         [Description("Vector3 One.")]
182         [Property("SPEC", "Tizen.NUI.Vector3.One A")]
183         [Property("SPEC_URL", "-")]
184         [Property("CRITERIA", "PRO")]
185         [Property("AUTHOR", "guowei.wang@samsung.com")]
186         public void Vector3One()
187         {
188             tlog.Debug(tag, $"Vector3One START");
189
190             var testingTarget = Vector3.One;
191             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
192             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
193
194             Assert.AreEqual(1.0f, testingTarget.X, "The value of Vector3.One.X is not correct!");
195             Assert.AreEqual(1.0f, testingTarget.Y, "The value of Vector3.One.Y is not correct!");
196             Assert.AreEqual(1.0f, testingTarget.Z, "The value of Vector3.One.Z is not correct!");
197
198             testingTarget.Dispose();
199             tlog.Debug(tag, $"Vector3One END (OK)");
200         }
201
202
203         [Test]
204         [Category("P1")]
205         [Description("Vector3 XAxis.")]
206         [Property("SPEC", "Tizen.NUI.Vector3.XAxis A")]
207         [Property("SPEC_URL", "-")]
208         [Property("CRITERIA", "PRO")]
209         [Property("AUTHOR", "guowei.wang@samsung.com")]
210         public void Vector3XAxis()
211         {
212             tlog.Debug(tag, $"Vector3XAxis START");
213
214             var testingTarget = Vector3.XAxis;
215             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
216             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
217
218             Assert.AreEqual(1.0f, testingTarget.X, "The value of Vector3.XAxis.X is not correct!");
219             Assert.AreEqual(0.0f, testingTarget.Y, "The value of Vector3.XAxis.Y is not correct!");
220             Assert.AreEqual(0.0f, testingTarget.Z, "The value of Vector3.XAxis.Z is not correct!");
221
222             testingTarget.Dispose();
223             tlog.Debug(tag, $"Vector3XAxis END (OK)");
224         }
225
226         [Test]
227         [Category("P1")]
228         [Description("Vector3 YAxis.")]
229         [Property("SPEC", "Tizen.NUI.Vector3.YAxis A")]
230         [Property("SPEC_URL", "-")]
231         [Property("CRITERIA", "PRO")]
232         [Property("AUTHOR", "guowei.wang@samsung.com")]
233         public void Vector3YAxis()
234         {
235             tlog.Debug(tag, $"Vector3YAxis START");
236
237             var testingTarget = Vector3.YAxis;
238             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
239             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
240
241             Assert.AreEqual(0.0f, testingTarget.X, "The value of Vector3.YAxis.X is not correct!");
242             Assert.AreEqual(1.0f, testingTarget.Y, "The value of Vector3.YAxis.Y is not correct!");
243             Assert.AreEqual(0.0f, testingTarget.Z, "The value of Vector3.YAxis.Z is not correct!");
244
245             testingTarget.Dispose();
246             tlog.Debug(tag, $"Vector3YAxis END (OK)");
247         }
248
249         [Test]
250         [Category("P1")]
251         [Description("Vector3 ZAxis.")]
252         [Property("SPEC", "Tizen.NUI.Vector3.ZAxis A")]
253         [Property("SPEC_URL", "-")]
254         [Property("CRITERIA", "PRO")]
255         [Property("AUTHOR", "guowei.wang@samsung.com")]
256         public void Vector3ZAxis()
257         {
258             tlog.Debug(tag, $"Vector3ZAxis START");
259
260             var testingTarget = Vector3.ZAxis;
261             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
262             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
263
264             Assert.AreEqual(0.0f, testingTarget.X, "The value of Vector3.ZAxis.X is not correct!");
265             Assert.AreEqual(0.0f, testingTarget.Y, "The value of Vector3.ZAxis.Y is not correct!");
266             Assert.AreEqual(1.0f, testingTarget.Z, "The value of Vector3.ZAxis.Z is not correct!");
267
268             testingTarget.Dispose();
269             tlog.Debug(tag, $"Vector3ZAxis END (OK)");
270         }
271
272         [Test]
273         [Category("P1")]
274         [Description("Vector3 NegativeXAxis.")]
275         [Property("SPEC", "Tizen.NUI.Vector3.NegativeXAxis A")]
276         [Property("SPEC_URL", "-")]
277         [Property("CRITERIA", "PRO")]
278         [Property("AUTHOR", "guowei.wang@samsung.com")]
279         public void Vector3NegativeXAxis()
280         {
281             tlog.Debug(tag, $"Vector3NegativeXAxis START");
282
283             var testingTarget = Vector3.NegativeXAxis;
284             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
285             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
286
287             Assert.AreEqual(-1.0f, testingTarget.X, "The value of Vector3.NegativeXAxis.X is not correct!");
288             Assert.AreEqual(0.0f, testingTarget.Y, "The value of Vector3.NegativeXAxis.Y is not correct!");
289             Assert.AreEqual(0.0f, testingTarget.Z, "The value of Vector3.NegativeXAxis.Z is not correct!");
290
291             testingTarget.Dispose();
292             tlog.Debug(tag, $"Vector3NegativeXAxis END (OK)");
293         }
294
295         [Test]
296         [Category("P1")]
297         [Description("Vector3 NegativeYAxis.")]
298         [Property("SPEC", "Tizen.NUI.Vector3.NegativeYAxis A")]
299         [Property("SPEC_URL", "-")]
300         [Property("CRITERIA", "PRO")]
301         [Property("AUTHOR", "guowei.wang@samsung.com")]
302         public void Vector3NegativeYAxis()
303         {
304             tlog.Debug(tag, $"Vector3NegativeYAxis START");
305
306             var testingTarget = Vector3.NegativeYAxis;
307             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
308             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
309
310             Assert.AreEqual(0.0f, testingTarget.X, "The value of Vector3.NegativeYAxis.X is not correct!");
311             Assert.AreEqual(-1.0f, testingTarget.Y, "The value of Vector3.NegativeYAxis.Y is not correct!");
312             Assert.AreEqual(0.0f, testingTarget.Z, "The value of Vector3.NegativeYAxis.Z is not correct!");
313
314             testingTarget.Dispose();
315             tlog.Debug(tag, $"Vector3NegativeYAxis END (OK)");
316         }
317
318         [Test]
319         [Category("P1")]
320         [Description("Vector3 NegativeZAxis.")]
321         [Property("SPEC", "Tizen.NUI.Vector3.NegativeZAxis A")]
322         [Property("SPEC_URL", "-")]
323         [Property("CRITERIA", "PRO")]
324         [Property("AUTHOR", "guowei.wang@samsung.com")]
325         public void Vector3NegativeZAxis()
326         {
327             tlog.Debug(tag, $"Vector3NegativeZAxis START");
328
329             var testingTarget = Vector3.NegativeZAxis;
330             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
331             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
332
333             Assert.AreEqual(0.0f, testingTarget.X, "The value of Vector3.NegativeZAxis.X is not correct!");
334             Assert.AreEqual(0.0f, testingTarget.Y, "The value of Vector3.NegativeZAxis.Y is not correct!");
335             Assert.AreEqual(-1.0f, testingTarget.Z, "The value of Vector3.NegativeZAxis.Z is not correct!");
336
337             testingTarget.Dispose();
338             tlog.Debug(tag, $"Vector3NegativeZAxis END (OK)");
339         }
340
341         [Test]
342         [Category("P1")]
343         [Description("Vector3 Zero.")]
344         [Property("SPEC", "Tizen.NUI.Vector3.Zero A")]
345         [Property("SPEC_URL", "-")]
346         [Property("CRITERIA", "PRO")]
347         [Property("AUTHOR", "guowei.wang@samsung.com")]
348         public void Vector3Zero()
349         {
350             tlog.Debug(tag, $"Vector3Zero START");
351
352             var testingTarget = Vector3.Zero;
353             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
354             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
355
356             Assert.AreEqual(0.0f, testingTarget.X, "The value of Vector3.Zero.X is not correct!");
357             Assert.AreEqual(0.0f, testingTarget.Y, "The value of Vector3.Zero.Y is not correct!");
358             Assert.AreEqual(0.0f, testingTarget.Z, "The value of Vector3.Zero.Z is not correct!");
359
360             testingTarget.Dispose();
361             tlog.Debug(tag, $"Vector3Zero END (OK)");
362         }
363
364         [Test]
365         [Category("P1")]
366         [Description("Vector3 Length.")]
367         [Property("SPEC", "Tizen.NUI.Vector3.Length M")]
368         [Property("SPEC_URL", "-")]
369         [Property("CRITERIA", "MR")]
370         [Property("AUTHOR", "guowei.wang@samsung.com")]
371         public void Vector3Length()
372         {
373             tlog.Debug(tag, $"Vector3Length START");
374
375             using (Vector3 vector = new Vector3(0.0f, 0.0f, 0.0f))
376             {
377                 Assert.AreEqual(0.0f, vector.Length(), "The length of vector is not correct!");
378             }
379
380             using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
381             {
382                 Assert.AreEqual((float)Math.Sqrt(14.0f), vector.Length(), "The length of vector is not correct here!");
383             }
384             
385             tlog.Debug(tag, $"Vector3Length END (OK)");
386         }
387
388         [Test]
389         [Category("P1")]
390         [Description("Vector3 LengthSquared.")]
391         [Property("SPEC", "Tizen.NUI.Vector3.LengthSquared M")]
392         [Property("SPEC_URL", "-")]
393         [Property("CRITERIA", "MR")]
394         [Property("AUTHOR", "guowei.wang@samsung.com")]
395         public void Vector3LengthSquared()
396         {
397             tlog.Debug(tag, $"Vector3LengthSquared START");
398
399             using (Vector3 vector = new Vector3(0.0f, 0.0f, 0.0f))
400             {
401                 Assert.AreEqual(0.0f, vector.LengthSquared(), "The length of vector is not correct!");
402             }
403
404             using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
405             {
406                 Assert.AreEqual(14.0f, vector.LengthSquared(), "The length of vector is not correct here!");
407             }
408
409             tlog.Debug(tag, $"Vector3LengthSquared END (OK)");
410         }
411
412         [Test]
413         [Category("P1")]
414         [Description("Vector3 Normalize.")]
415         [Property("SPEC", "Tizen.NUI.Vector3.Normalize M")]
416         [Property("SPEC_URL", "-")]
417         [Property("CRITERIA", "MCST")]
418         [Property("AUTHOR", "guowei.wang@samsung.com")]
419         public void Vector3Normalize()
420         {
421             tlog.Debug(tag, $"Vector3Normalize START");
422
423             using (Vector3 vector = new Vector3((float)Math.Cosh(0.0f) * 10.0f, (float)Math.Cosh(1.0f) * 10.0f, (float)Math.Cosh(2.0f) * 10.0f))
424             {
425                 vector.Normalize();
426                 Assert.Less(Math.Abs(1.0f - vector.LengthSquared()), 0.001f, "The value of LengthSquared is wrong");
427             }
428
429             using (Vector3 vector = new Vector3(0.0f, 0.0f, 0.0f))
430             {
431                 vector.Normalize();
432                 Assert.Less(Math.Abs(0.0f - vector.LengthSquared()), 0.00001f, "Should be return 0.0f");
433             }
434
435             tlog.Debug(tag, $"Vector3Normalize END (OK)");
436         }
437
438         [Test]
439         [Category("P1")]
440         [Description("Vector3 Clamp.")]
441         [Property("SPEC", "Tizen.NUI.Vector3.Clamp M")]
442         [Property("SPEC_URL", "-")]
443         [Property("CRITERIA", "MCST")]
444         [Property("AUTHOR", "guowei.wang@samsung.com")]
445         public void Vector3Clamp()
446         {
447             tlog.Debug(tag, $"Vector3Clamp START");
448
449             var testingTarget = new Vector3(2.0f, 0.8f, 8.0f);
450             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
451             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
452
453             testingTarget.Clamp(new Vector3(1.0f, 4.0f, 0.0f), new Vector3(9.0f, 6.0f, 6.0f));
454             Assert.AreEqual(2.0f, testingTarget.X, "2.0 > 1.0(min) && 2.0 < 9.0(max), so the value should be 2.0f");
455             Assert.AreEqual(4.0f, testingTarget.Y, "0.8 < 4.0(min), so the value should be 4.0f");
456             Assert.AreEqual(6.0f, testingTarget.Z, "8.0 > 6.0(max), so the value should be 6.0f");
457
458             testingTarget.Dispose();
459             tlog.Debug(tag, $"Vector3Clamp END (OK)");
460         }
461
462         [Test]
463         [Category("P1")]
464         [Description("Vector3 GetVectorXY.")]
465         [Property("SPEC", "Tizen.NUI.Vector3.GetVectorXY M")]
466         [Property("SPEC_URL", "-")]
467         [Property("CRITERIA", "MR")]
468         [Property("AUTHOR", "guowei.wang@samsung.com")]
469         public void Vector3GetVectorXY()
470         {
471             tlog.Debug(tag, $"Vector3GetVectorXY START");
472
473             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
474             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
475             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
476
477             Assert.AreEqual(10.0f, testingTarget.GetVectorXY().X, "The X value of the vector is not correct!");
478             Assert.AreEqual(20.0f, testingTarget.GetVectorXY().Y, "The Y value of the vector is not correct!");
479
480             testingTarget.Dispose();
481             tlog.Debug(tag, $"Vector3GetVectorXY END (OK)");
482         }
483
484         [Test]
485         [Category("P1")]
486         [Description("Vector3 GetVectorYZ.")]
487         [Property("SPEC", "Tizen.NUI.Vector3.GetVectorYZ M")]
488         [Property("SPEC_URL", "-")]
489         [Property("CRITERIA", "MR")]
490         [Property("AUTHOR", "guowei.wang@samsung.com")]
491         public void Vector3GetVectorYZ()
492         {
493             tlog.Debug(tag, $"Vector3GetVectorYZ START");
494
495             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
496             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
497             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
498
499             Assert.AreEqual(30.0f, testingTarget.GetVectorYZ().Y, "The Y value of the vector is not correct!");
500             Assert.AreEqual(20.0f, testingTarget.GetVectorYZ().X, "The X value of the vector is not correct!");
501
502             testingTarget.Dispose();
503             tlog.Debug(tag, $"Vector3GetVectorYZ END (OK)");
504         }
505
506         [Test]
507         [Category("P1")]
508         [Description("Vector3 Width.")]
509         [Property("SPEC", "Tizen.NUI.Vector3.Width A")]
510         [Property("SPEC_URL", "-")]
511         [Property("CRITERIA", "PRW")]
512         [Property("AUTHOR", "guowei.wang@samsung.com")]
513         [Obsolete]
514         public void Vector3Width()
515         {
516             tlog.Debug(tag, $"Vector3Width START");
517
518             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
519             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
520             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
521
522             Assert.AreEqual(10.0f, testingTarget.Width, "The Width value of the vector is not correct!");
523             
524             testingTarget.Width = 100.0f;
525             Assert.AreEqual(100.0f, testingTarget.Width, "The Width value of the vector is not correct here.");
526
527             testingTarget.Dispose();
528             tlog.Debug(tag, $"Vector3Width END (OK)");
529         }
530
531
532         [Test]
533         [Category("P1")]
534         [Description("Vector3 Height.")]
535         [Property("SPEC", "Tizen.NUI.Vector3.Height A")]
536         [Property("SPEC_URL", "-")]
537         [Property("CRITERIA", "PRW")]
538         [Property("AUTHOR", "guowei.wang@samsung.com")]
539         [Obsolete]
540         public void Vector3Height()
541         {
542             tlog.Debug(tag, $"Vector3Height START");
543
544             Vector3 testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
545             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
546             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
547
548             Assert.AreEqual(20.0f, testingTarget.Height, "The Height value of the vector is not correct!");
549
550             testingTarget.Height = 100.0f;
551             Assert.AreEqual(100.0f, testingTarget.Height, "The Height value of the vector is not correct here.");
552
553             testingTarget.Dispose();
554             tlog.Debug(tag, $"Vector3Height END (OK)");
555         }
556
557         [Test]
558         [Category("P1")]
559         [Description("Vector3 Depth.")]
560         [Property("SPEC", "Tizen.NUI.Vector3.Depth A")]
561         [Property("SPEC_URL", "-")]
562         [Property("CRITERIA", "PRW")]
563         [Property("AUTHOR", "guowei.wang@samsung.com")]
564         [Obsolete]
565         public void Vector3Depth()
566         {
567             tlog.Debug(tag, $"Vector3Depth START");
568
569             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
570             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
571             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
572
573             Assert.AreEqual(30.0f, testingTarget.Depth, "The Depth value of the vector is not correct!");
574             
575             testingTarget.Depth = 100.0f;
576             Assert.AreEqual(100.0f, testingTarget.Depth, "The Depth value of the vector is not correct here.");
577
578             testingTarget.Dispose();
579             tlog.Debug(tag, $"Vector3Depth END (OK)");
580         }
581
582         [Test]
583         [Category("P1")]
584         [Description("Vector3 R.")]
585         [Property("SPEC", "Tizen.NUI.Vector3.R A")]
586         [Property("SPEC_URL", "-")]
587         [Property("CRITERIA", "PRO")]
588         [Property("AUTHOR", "guowei.wang@samsung.com")]
589         public void Vector3GetR()
590         {
591             tlog.Debug(tag, $"Vector3GetR START");
592
593             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
594             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
595             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
596
597             Assert.AreEqual(10.0f, testingTarget.R, "The R value of the vector is not correct!");
598
599             testingTarget.Dispose();
600             tlog.Debug(tag, $"Vector3GetR END (OK)");
601         }
602
603         [Test]
604         [Category("P1")]
605         [Description("Vector3 G.")]
606         [Property("SPEC", "Tizen.NUI.Vector3.G A")]
607         [Property("SPEC_URL", "-")]
608         [Property("CRITERIA", "PRO")]
609         [Property("AUTHOR", "guowei.wang@samsung.com")]
610         public void Vector3GetG()
611         {
612             tlog.Debug(tag, $"Vector3GetG START");
613
614             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
615             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
616             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
617
618             Assert.AreEqual(20.0f, testingTarget.G, "The G value of the vector is not correct!");
619
620             testingTarget.Dispose();
621             tlog.Debug(tag, $"Vector3GetG END (OK)");
622         }
623
624         [Test]
625         [Category("P1")]
626         [Description("Vector3 B.")]
627         [Property("SPEC", "Tizen.NUI.Vector3.B A")]
628         [Property("SPEC_URL", "-")]
629         [Property("CRITERIA", "PRO")]
630         [Property("AUTHOR", "guowei.wang@samsung.com")]
631         public void Vector3GetB()
632         {
633             tlog.Debug(tag, $"Vector3GetB START");
634
635             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
636             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
637             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
638
639             Assert.AreEqual(30.0f, testingTarget.B, "The B value of the vector is not correct!");
640
641             testingTarget.Dispose();
642             tlog.Debug(tag, $"Vector3GetB END (OK)");
643         }
644         [Test]
645         [Category("P1")]
646         [Description("Vector3 X.")]
647         [Property("SPEC", "Tizen.NUI.Vector3.X A")]
648         [Property("SPEC_URL", "-")]
649         [Property("CRITERIA", "PRO")]
650         [Property("AUTHOR", "guowei.wang@samsung.com")]
651         public void Vector3GetX()
652         {
653             tlog.Debug(tag, $"Vector3GetX START");
654
655             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
656             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
657             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
658
659             Assert.AreEqual(10.0f, testingTarget.X, "The X value of the vector is not correct!");
660
661             testingTarget.Dispose();
662             tlog.Debug(tag, $"Vector3GetX END (OK)");
663         }
664
665         [Test]
666         [Category("P1")]
667         [Description("Vector3 Y.")]
668         [Property("SPEC", "Tizen.NUI.Vector3.Y A")]
669         [Property("SPEC_URL", "-")]
670         [Property("CRITERIA", "PRO")]
671         [Property("AUTHOR", "guowei.wang@samsung.com")]
672         public void Vector3GetY()
673         {
674             tlog.Debug(tag, $"Vector3GetY START");
675
676             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
677             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
678             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
679
680             Assert.AreEqual(20.0f, testingTarget.Y, "The Y value of the vector is not correct!");
681
682             testingTarget.Dispose();
683             tlog.Debug(tag, $"Vector3GetY END (OK)");
684         }
685
686         [Test]
687         [Category("P1")]
688         [Description("Vector3 Z.")]
689         [Property("SPEC", "Tizen.NUI.Vector3.Z A")]
690         [Property("SPEC_URL", "-")]
691         [Property("CRITERIA", "PRO")]
692         [Property("AUTHOR", "guowei.wang@samsung.com")]
693         public void Vector3GetZ()
694         {
695             tlog.Debug(tag, $"Vector3GetZ START");
696
697             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
698             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
699             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
700
701             Assert.AreEqual(30.0f, testingTarget.Z, "The Z value of the vector is not correct!");
702
703             testingTarget.Dispose();
704             tlog.Debug(tag, $"Vector3GetZ END (OK)");
705         }
706
707         [Test]
708         [Category("P1")]
709         [Description("Vector3 operator +.")]
710         [Property("SPEC", "Tizen.NUI.Vector3.+ M")]
711         [Property("SPEC_URL", "-")]
712         [Property("CRITERIA", "MR")]
713         [Property("AUTHOR", "guowei.wang@samsung.com")]
714         public void Vector3Addition()
715         {
716             tlog.Debug(tag, $"Vector3Addition START");
717
718             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
719             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
720             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
721
722             using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
723             {
724                 var result = testingTarget + vector;
725                 Assert.AreEqual(11.0f, result.X, "The X value of the vector is not correct!");
726                 Assert.AreEqual(22.0f, result.Y, "The Y value of the vector is not correct!");
727                 Assert.AreEqual(33.0f, result.Z, "The Z value of the vector is not correct!");
728             }
729
730             testingTarget.Dispose();
731             tlog.Debug(tag, $"Vector3Addition END (OK)");
732         }
733
734         [Test]
735         [Category("P1")]
736         [Description("Vector3 operator -.")]
737         [Property("SPEC", "Tizen.NUI.Vector3.- M")]
738         [Property("SPEC_URL", "-")]
739         [Property("CRITERIA", "MR")]
740         [Property("AUTHOR", "guowei.wang@samsung.com")]
741         public void Vector3Subtraction()
742         {
743             tlog.Debug(tag, $"Vector3Subtraction START");
744
745             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
746             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
747             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
748
749             using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
750             {
751                 var result = testingTarget - vector;
752                 Assert.AreEqual(9.0f, result.X, "The X value of the vector is not correct!");
753                 Assert.AreEqual(18.0f, result.Y, "The Y value of the vector is not correct!");
754                 Assert.AreEqual(27.0f, result.Z, "The Z value of the vector is not correct!");
755             }
756
757             testingTarget.Dispose();
758             tlog.Debug(tag, $"Vector3Subtraction END (OK)");
759         }
760
761         [Test]
762         [Category("P1")]
763         [Description("Vector3 operator -.")]
764         [Property("SPEC", "Tizen.NUI.Vector3.UnaryNegation M")]
765         [Property("SPEC_URL", "-")]
766         [Property("CRITERIA", "MR")]
767         [Property("AUTHOR", "guowei.wang@samsung.com")]
768         public void Vector3UnaryNegation()
769         {
770             tlog.Debug(tag, $"Vector3UnaryNegation START");
771
772             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
773             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
774             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
775
776             var result = -testingTarget;
777             Assert.AreEqual(-10.0f, result.X, "The X value of the vector is not correct!");
778             Assert.AreEqual(-20.0f, result.Y, "The Y value of the vector is not correct!");
779             Assert.AreEqual(-30.0f, result.Z, "The Z value of the vector is not correct!");
780
781             testingTarget.Dispose();
782             tlog.Debug(tag, $"Vector3UnaryNegation END (OK)");
783         }
784
785         [Test]
786         [Category("P1")]
787         [Description("Vector3 operator *. By Vector3.")]
788         [Property("SPEC", "Tizen.NUI.Vector3.* M")]
789         [Property("SPEC_URL", "-")]
790         [Property("CRITERIA", "MR")]
791         [Property("COVPARAM", "Vector3, Vector3")]
792         [Property("AUTHOR", "guowei.wang@samsung.com")]
793         public void Vector3MultiplyByVector3()
794         {
795             tlog.Debug(tag, $"Vector3MultiplyByVector3 START");
796
797             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
798             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
799             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
800
801             using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
802             {
803                 var result = testingTarget * vector;
804                 Assert.AreEqual(10.0f, result.X, "The X value of the vector is not correct!");
805                 Assert.AreEqual(40.0f, result.Y, "The Y value of the vector is not correct!");
806                 Assert.AreEqual(90.0f, result.Z, "The Z value of the vector is not correct!");
807             }
808
809             testingTarget.Dispose();
810             tlog.Debug(tag, $"Vector3MultiplyByVector3 END (OK)");
811         }
812
813         [Test]
814         [Category("P1")]
815         [Description("Vector3 operator *. By Float.")]
816         [Property("SPEC", "Tizen.NUI.Vector3.* M")]
817         [Property("SPEC_URL", "-")]
818         [Property("CRITERIA", "MR")]
819         [Property("COVPARAM", "Vector3, Single")]
820         [Property("AUTHOR", "guowei.wang@samsung.com")]
821         public void Vector3MultiplyByFloat()
822         {
823             tlog.Debug(tag, $"Vector3MultiplyByFloat START");
824
825             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
826             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
827             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
828
829             var result = testingTarget * 10.0f;
830             Assert.AreEqual(100.0f, result.X, "The X value of the vector is not correct!");
831             Assert.AreEqual(200.0f, result.Y, "The Y value of the vector is not correct!");
832             Assert.AreEqual(300.0f, result.Z, "The Z value of the vector is not correct!");
833
834             testingTarget.Dispose();
835             tlog.Debug(tag, $"Vector3MultiplyByFloat END (OK)");
836         }
837
838         [Test]
839         [Category("P1")]
840         [Description("Vector3 operator /. By Vector3.")]
841         [Property("SPEC", "Tizen.NUI.Vector3./ M")]
842         [Property("SPEC_URL", "-")]
843         [Property("CRITERIA", "MR")]
844         [Property("COVPARAM", "Vector3, Vector3")]
845         [Property("AUTHOR", "guowei.wang@samsung.com")]
846         public void Vector3DivisionByVector3()
847         {
848             tlog.Debug(tag, $"Vector3DivisionByVector3 START");
849
850             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
851             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
852             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
853
854             using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
855             {
856                 var result = testingTarget / vector;
857                 Assert.AreEqual(10.0f, result.X, "The X value of the vector is not correct!");
858                 Assert.AreEqual(10.0f, result.Y, "The Y value of the vector is not correct!");
859                 Assert.AreEqual(10.0f, result.Z, "The Z value of the vector is not correct!");
860             }
861
862             testingTarget.Dispose();
863             tlog.Debug(tag, $"Vector3DivisionByVector3 END (OK)");
864         }
865
866         [Test]
867         [Category("P1")]
868         [Description("Vector3 operator /. By Float.")]
869         [Property("SPEC", "Tizen.NUI.Vector3./ M")]
870         [Property("SPEC_URL", "-")]
871         [Property("CRITERIA", "MR")]
872         [Property("COVPARAM", "Vector3, Single")]
873         [Property("AUTHOR", "guowei.wang@samsung.com")]
874         public void Vector3DivisionByFloat()
875         {
876             tlog.Debug(tag, $"Vector3DivisionByFloat START");
877
878             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
879             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
880             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
881
882             var result = testingTarget / 10.0f;
883             Assert.AreEqual(1.0f, result.X, "The X value of the vector is not correct!");
884             Assert.AreEqual(2.0f, result.Y, "The Y value of the vector is not correct!");
885             Assert.AreEqual(3.0f, result.Z, "The Z value of the vector is not correct!");
886
887             testingTarget.Dispose();
888             tlog.Debug(tag, $"Vector3DivisionByFloat END (OK)");
889         }
890
891         [Test]
892         [Category("P1")]
893         [Description("Vector3 Equals.")]
894         [Property("SPEC", "Tizen.NUI.Vector3.Equals M")]
895         [Property("SPEC_URL", "-")]
896         [Property("CRITERIA", "MR")]
897         [Property("AUTHOR", "guowei.wang@samsung.com")]
898         public void Vector3Equals()
899         {
900             tlog.Debug(tag, $"Vector3Equals START");
901
902             var testingTarget = new Vector3(1.0f, 1.0f, 1.0f);
903             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
904             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
905
906             using (Vector3 vector = new Vector3(1.0f, 1.0f, 1.0f))
907             {
908                 var result = testingTarget.Equals(vector);
909                 Assert.IsTrue(result, "Should be true here!");
910             }
911
912             testingTarget.Dispose();
913             tlog.Debug(tag, $"Vector3Equals END (OK)");
914         }
915
916         [Test]
917         [Category("P1")]
918         [Description("Vector3 Dispose.")]
919         [Property("SPEC", "Tizen.NUI.Vector3.Dispose M")]
920         [Property("SPEC_URL", "-")]
921         [Property("CRITERIA", "MR MCST")]
922         [Property("AUTHOR", "guowei.wang@samsung.com")]
923         public void Vector3Dispose()
924         {
925             tlog.Debug(tag, $"Vector3Dispose START");
926
927             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
928             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
929             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
930
931             try
932             {
933                 testingTarget.Dispose();
934             }
935             catch (Exception e)
936             {
937                 Assert.Fail("Caught Exception" + e.ToString());
938             }
939
940             tlog.Debug(tag, $"Vector3Dispose END (OK)");
941         }
942
943         [Test]
944         [Category("P1")]
945         [Description("Vector3 GetHashCode.")]
946         [Property("SPEC", "Tizen.NUI.Vector3.GetHashCode M")]
947         [Property("SPEC_URL", "-")]
948         [Property("CRITERIA", "MR")]
949         [Property("AUTHOR", "guowei.wang@samsung.com")]
950         public void Vector3GetHashCode()
951         {
952             tlog.Debug(tag, $"Vector3GetHashCode START");
953
954             var testingTarget = new Vector3(10.0f, 20.0f, 30.0f);
955             Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
956             Assert.IsInstanceOf<Vector3>(testingTarget, "Should be an instance of Vector3 type.");
957
958             var result = testingTarget.GetHashCode();
959             Assert.IsTrue(result >= Int32.MinValue && result <= Int32.MaxValue, "The value of hash is out of Integer range");
960
961             testingTarget.Dispose();
962             tlog.Debug(tag, $"Vector3GetHashCode END (OK)");
963         }
964     }
965 }