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;
9 namespace Tizen.NUI.Devel.Tests
11 using tlog = Tizen.Log;
14 [Description("public/Common/Vector4")]
15 public class PublicVector4Test
17 private const string tag = "NUITEST";
22 tlog.Info(tag, "Init() is called!");
28 tlog.Info(tag, "Destroy() is called!");
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()
41 tlog.Debug(tag, $"Vector4Constructor START");
43 var testingTarget = new Vector4();
44 Assert.IsNotNull(testingTarget, "Can't create success object Vector4");
45 Assert.IsInstanceOf<Vector4>(testingTarget, "Should return Vector4 instance.");
47 testingTarget.Dispose();
48 tlog.Debug(tag, $"Vector4Constructor END (OK)");
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()
61 tlog.Debug(tag, $"Vector4ConstructorWithFloat START");
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.");
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");
72 testingTarget.Dispose();
73 tlog.Debug(tag, $"Vector4ConstructorWithFloat END (OK)");
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()
86 tlog.Debug(tag, $"Vector4ConstructorWithArray START");
88 float[] array = new float[4] { 100.0f, 200.0f, 300.0f, 400.0f };
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.");
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");
99 testingTarget.Dispose();
100 tlog.Debug(tag, $"Vector4ConstructorWithArray END (OK)");
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()
113 tlog.Debug(tag, $"Vector4ConstructorWithVetcor2 START");
115 using (Vector2 vector = new Vector2(100.0f, 200.0f))
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.");
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");
126 testingTarget.Dispose();
129 tlog.Debug(tag, $"Vector4ConstructorWithVetcor2 END (OK)");
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()
142 tlog.Debug(tag, $"Vector4ConstructorWithVector3 START");
144 using (Vector3 vector = new Vector3(100.0f, 200.0f, 300.0f))
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.");
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");
155 testingTarget.Dispose();
158 tlog.Debug(tag, $"Vector4ConstructorWithVector3 END (OK)");
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()
170 tlog.Debug(tag, $"Vector4GetVauleBySubscriptIndex START");
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.");
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");
181 testingTarget.Dispose();
182 tlog.Debug(tag, $"Vector4GetVauleBySubscriptIndex END (OK)");
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()
194 tlog.Debug(tag, $"Vector4One START");
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.");
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");
205 testingTarget.Dispose();
206 tlog.Debug(tag, $"Vector4One END (OK)");
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()
219 tlog.Debug(tag, $"Vector4XAxis START");
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.");
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");
230 testingTarget.Dispose();
231 tlog.Debug(tag, $"Vector4XAxis END (OK)");
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()
243 tlog.Debug(tag, $"Vector4YAxis START");
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.");
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");
254 testingTarget.Dispose();
255 tlog.Debug(tag, $"Vector4YAxis END (OK)");
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()
267 tlog.Debug(tag, $"Vector4ZAxis START");
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.");
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");
278 testingTarget.Dispose();
279 tlog.Debug(tag, $"Vector4ZAxis END (OK)");
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()
291 tlog.Debug(tag, $"Vector4Zero START");
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.");
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");
302 testingTarget.Dispose();
303 tlog.Debug(tag, $"Vector4Zero END (OK)");
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()
315 tlog.Debug(tag, $"Vector4Length START");
317 using (Vector4 testingTarget = new Vector4(0.0f, 0.0f, 0.0f, 0.0f))
319 Assert.AreEqual(0.0f, testingTarget.Length(), "Length == sqrt(0.0*0.0 + 0.0*0.0 + 0.0*0.0)");
322 using (Vector4 testingTarget = new Vector4(1.0f, 2.0f, 3.0f, 4.0f))
324 Assert.AreEqual((float)Math.Sqrt(14.0f), testingTarget.Length(), "Length == sqrt(1.0*1.0 + 2.0*2.0 + 3.0*3.0)");
327 tlog.Debug(tag, $"Vector4Length END (OK)");
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()
339 tlog.Debug(tag, $"Vector4LengthSquared START");
341 using (Vector4 testingTarget = new Vector4(0.0f, 0.0f, 0.0f, 0.0f))
343 Assert.AreEqual(0.0f, testingTarget.LengthSquared(), "LengthSquared == (0.0*0.0 + 0.0*0.0 + 0.0*0.0)");
346 using (Vector4 testingTarget = new Vector4(1.0f, 2.0f, 3.0f, 4.0f))
348 Assert.AreEqual(14.0f, testingTarget.LengthSquared(), "LengthSquared == (1.0*1.0 + 2.0*2.0 + 3.0*3.0)");
351 tlog.Debug(tag, $"Vector4LengthSquared END (OK)");
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()
363 tlog.Debug(tag, $"Vector4Normalize START");
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.");
369 testingTarget.Normalize();
370 Assert.Less(Math.Abs(1.0f - testingTarget.LengthSquared()), 0.001f, "The value of LengthSquared is wrong");
372 testingTarget.Dispose();
373 tlog.Debug(tag, $"Vector4Normalize END (OK)");
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()
385 tlog.Debug(tag, $"Vector4Clamp START");
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.");
391 using (Vector4 min = new Vector4(1.0f, 4.0f, 1.5f, 0.0f))
393 using (Vector4 max = new Vector4(9.0f, 6.0f, 8.0f, 6.0f))
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");
403 testingTarget.Dispose();
404 tlog.Debug(tag, $"Vector4Clamp END (OK)");
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")]
415 public void Vector4GetX()
417 tlog.Debug(tag, $"Vector4GetX START");
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.");
423 testingTarget.X = 20.0f;
424 Assert.AreEqual(20.0f, testingTarget.X, "testingTarget.X should be 20.0f");
426 testingTarget.Dispose();
427 tlog.Debug(tag, $"Vector4GetX END (OK)");
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")]
438 public void Vector4GetR()
440 tlog.Debug(tag, $"Vector4GetR START");
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.");
446 testingTarget.R = 1.0f;
447 Assert.AreEqual(1.0f, testingTarget.R, "testingTarget.R should be 20.0f");
449 testingTarget.Dispose();
450 tlog.Debug(tag, $"Vector4GetR END (OK)");
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")]
461 public void Vector4GetS()
463 tlog.Debug(tag, $"Vector4GetS START");
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.");
469 testingTarget.S = 1.0f;
470 Assert.AreEqual(1.0f, testingTarget.S, "testingTarget.S should be 20.0f");
472 testingTarget.Dispose();
473 tlog.Debug(tag, $"Vector4GetS END (OK)");
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")]
484 public void Vector4GetY()
486 tlog.Debug(tag, $"Vector4GetY START");
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.");
492 testingTarget.Y = 1.0f;
493 Assert.AreEqual(1.0f, testingTarget.Y, "testingTarget.Y should be 20.0f");
495 testingTarget.Dispose();
496 tlog.Debug(tag, $"Vector4GetY END (OK)");
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")]
507 public void Vector4GetG()
509 tlog.Debug(tag, $"Vector4GetG START");
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.");
515 testingTarget.G = 1.0f;
516 Assert.AreEqual(1.0f, testingTarget.G, "testingTarget.G should be 20.0f");
518 testingTarget.Dispose();
519 tlog.Debug(tag, $"Vector4GetG END (OK)");
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")]
530 public void Vector4GetT()
532 tlog.Debug(tag, $"Vector4GetT START");
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.");
538 testingTarget.T = 1.0f;
539 Assert.AreEqual(1.0f, testingTarget.T, "testingTarget.T should be 1.0f");
541 testingTarget.Dispose();
542 tlog.Debug(tag, $"Vector4GetT END (OK)");
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")]
553 public void Vector4GetZ()
555 tlog.Debug(tag, $"Vector4GetZ START");
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.");
561 testingTarget.Z = 1.0f;
562 Assert.AreEqual(1.0f, testingTarget.Z, "testingTarget.Z should be 1.0f");
564 testingTarget.Dispose();
565 tlog.Debug(tag, $"Vector4GetZ END (OK)");
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")]
576 public void Vector4GetB()
578 tlog.Debug(tag, $"Vector4GetB START");
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.");
584 testingTarget.B = 1.0f;
585 Assert.AreEqual(1.0f, testingTarget.B, "testingTarget.B should be 1.0f");
587 testingTarget.Dispose();
588 tlog.Debug(tag, $"Vector4GetB END (OK)");
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")]
599 public void Vector4GetP()
601 tlog.Debug(tag, $"Vector4GetP START");
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.");
607 testingTarget.P = 1.0f;
608 Assert.AreEqual(1.0f, testingTarget.P, "testingTarget.P should be 1.0f");
610 testingTarget.Dispose();
611 tlog.Debug(tag, $"Vector4GetP END (OK)");
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")]
622 public void Vector4GetW()
624 tlog.Debug(tag, $"Vector4GetW START");
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.");
630 testingTarget.W = 1.0f;
631 Assert.AreEqual(1.0f, testingTarget.W, "testingTarget.W should be 1.0f");
633 testingTarget.Dispose();
634 tlog.Debug(tag, $"Vector4GetW END (OK)");
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")]
645 public void Vector4GetA()
647 tlog.Debug(tag, $"Vector4GetA START");
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.");
653 testingTarget.A = 1.0f;
654 Assert.AreEqual(1.0f, testingTarget.A, "testingTarget.A should be 1.0f");
656 testingTarget.Dispose();
657 tlog.Debug(tag, $"Vector4GetA END (OK)");
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")]
668 public void Vector4GetQ()
670 tlog.Debug(tag, $"Vector4GetQ START");
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.");
676 testingTarget.Q = 1.0f;
677 Assert.AreEqual(1.0f, testingTarget.Q, "testingTarget.Q should be 1.0f");
679 testingTarget.Dispose();
680 tlog.Debug(tag, $"Vector4GetQ END (OK)");
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()
692 tlog.Debug(tag, $"Vector4Addition START");
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.");
698 using (Vector4 vector = new Vector4(1.0f, 2.0f, 3.0f, 4.0f))
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");
707 testingTarget.Dispose();
708 tlog.Debug(tag, $"Vector4Addition END (OK)");
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()
720 tlog.Debug(tag, $"Vector4Subtraction START");
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.");
726 using (Vector4 vector = new Vector4(1.0f, 2.0f, 3.0f, 4.0f))
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");
735 testingTarget.Dispose();
736 tlog.Debug(tag, $"Vector4Subtraction END (OK)");
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()
748 tlog.Debug(tag, $"Vector4UnaryNegation START");
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.");
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");
760 testingTarget.Dispose();
761 tlog.Debug(tag, $"Vector4UnaryNegation END (OK)");
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()
774 tlog.Debug(tag, $"Vector4MultiplyByVector4 START");
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.");
780 using (Vector4 vector = new Vector4(1.0f, 2.0f, 3.0f, 4.0f))
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");
789 testingTarget.Dispose();
790 tlog.Debug(tag, $"Vector4MultiplyByVector4 END (OK)");
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()
803 tlog.Debug(tag, $"Vector4MultiplyByFloat START");
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.");
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");
815 testingTarget.Dispose();
816 tlog.Debug(tag, $"Vector4MultiplyByFloat END (OK)");
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()
829 tlog.Debug(tag, $"Vector4DivisionByVector4 START");
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.");
835 using (Vector4 vector = new Vector4(1.0f, 2.0f, 3.0f, 4.0f))
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");
844 testingTarget.Dispose();
845 tlog.Debug(tag, $"Vector4DivisionByVector4 END (OK)");
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()
858 tlog.Debug(tag, $"Vector4DivisionByFloat START");
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.");
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");
870 testingTarget.Dispose();
871 tlog.Debug(tag, $"Vector4DivisionByFloat END (OK)");
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()
883 tlog.Debug(tag, $"Vector4Equals START");
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.");
889 using (Vector4 vector = new Vector4(1.0f, 1.0f, 1.0f, 1.0f))
891 var result = testingTarget.Equals(vector);
892 Assert.IsTrue(result, "Should be true here!");
895 testingTarget.Dispose();
896 tlog.Debug(tag, $"Vector4Equals END (OK)");
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()
908 tlog.Debug(tag, $"Vector4Dispose START");
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.");
916 testingTarget.Dispose();
920 Assert.Fail("Caught Exception" + e.ToString());
923 tlog.Debug(tag, $"Vector4Dispose END (OK)");
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()
935 tlog.Debug(tag, $"Vector4GetHashCode START");
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.");
941 var result = testingTarget.GetHashCode();
942 Assert.IsTrue(result >= Int32.MinValue && result <= Int32.MaxValue, "The value of hash is out of Integer range");
944 testingTarget.Dispose();
945 tlog.Debug(tag, $"Vector4GetHashCode END (OK)");
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()
957 tlog.Debug(tag, $"Vector4AsFloat START");
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.");
963 var result = testingTarget.AsFloat();
964 Assert.IsInstanceOf<SWIGTYPE_p_float>(result, "Should be an instance of SWIGTYPE_p_float type.");
966 testingTarget.Dispose();
967 tlog.Debug(tag, $"Vector4GetHashCode END (OK)");
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()
979 tlog.Debug(tag, $"Vector4Cross START");
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.");
985 var result = testingTarget.Cross(testingTarget);
986 Assert.IsInstanceOf<Vector4>(testingTarget, "Should be an instance of Vector4 type.");
988 testingTarget.Dispose();
989 tlog.Debug(tag, $"Vector4Cross END (OK)");
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()
1001 tlog.Debug(tag, $"Vector4Dot START");
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.");
1007 var result = testingTarget.Dot(testingTarget);
1008 tlog.Debug(tag, "Dot : " + result);
1010 result = testingTarget.Dot4(testingTarget);
1011 tlog.Debug(tag, "Dot4 : " + result);
1013 using (Vector3 vector = new Vector3(10.0f, 20.0f, 30.0f))
1015 result = testingTarget.Dot(vector);
1016 tlog.Debug(tag, "Dot Vector3 : " + result);
1019 testingTarget.Dispose();
1020 tlog.Debug(tag, $"Vector4Dot END (OK)");