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