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/Vector3")]
15 public class PublicVector3Test
17 private const string tag = "NUITEST";
22 tlog.Info(tag, "Init() is called!");
28 tlog.Info(tag, "Destroy() is called!");
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()
40 tlog.Debug(tag, $"Vector3Constructor START");
42 var testingTarget = new Vector3();
43 Assert.IsNotNull(testingTarget, "Can't create success object Vector3");
44 Assert.IsInstanceOf<Vector3>(testingTarget, "Should return Vector3 instance.");
46 testingTarget.Dispose();
47 tlog.Debug(tag, $"Vector3Constructor END (OK)");
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()
60 tlog.Debug(tag, $"Vector3ConstructorWithFloat START");
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.");
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");
70 testingTarget.Dispose();
71 tlog.Debug(tag, $"Vector3ConstructorWithFloat END (OK)");
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()
84 tlog.Debug(tag, $"Vector3ConstructorWithArray START");
86 float[] array = new float[3] { 100.0f, 200.0f, 300.0f };
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.");
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");
96 testingTarget.Dispose();
97 tlog.Debug(tag, $"Vector3ConstructorWithArray END (OK)");
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()
110 tlog.Debug(tag, $"Vector3ConstructorWithVector2 START");
112 using (Vector2 vec2 = new Vector2(100.0f, 200.0f))
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.");
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");
122 testingTarget.Dispose();
125 tlog.Debug(tag, $"Vector3ConstructorWithVector2 END (OK)");
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()
138 tlog.Debug(tag, $"Vector3ConstructorWithVector4 START");
140 using (Vector4 vec4 = new Vector4(100.0f, 200.0f, 300.0f, 400.0f))
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.");
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");
150 testingTarget.Dispose();
153 tlog.Debug(tag, $"Vector3ConstructorWithVector4 END (OK)");
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()
165 tlog.Debug(tag, $"Vector3GetVauleBySubscriptIndex START");
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.");
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!");
175 testingTarget.Dispose();
176 tlog.Debug(tag, $"Vector3GetVauleBySubscriptIndex END (OK)");
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()
188 tlog.Debug(tag, $"Vector3One START");
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.");
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!");
198 testingTarget.Dispose();
199 tlog.Debug(tag, $"Vector3One END (OK)");
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()
212 tlog.Debug(tag, $"Vector3XAxis START");
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.");
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!");
222 testingTarget.Dispose();
223 tlog.Debug(tag, $"Vector3XAxis END (OK)");
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()
235 tlog.Debug(tag, $"Vector3YAxis START");
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.");
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!");
245 testingTarget.Dispose();
246 tlog.Debug(tag, $"Vector3YAxis END (OK)");
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()
258 tlog.Debug(tag, $"Vector3ZAxis START");
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.");
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!");
268 testingTarget.Dispose();
269 tlog.Debug(tag, $"Vector3ZAxis END (OK)");
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()
281 tlog.Debug(tag, $"Vector3NegativeXAxis START");
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.");
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!");
291 testingTarget.Dispose();
292 tlog.Debug(tag, $"Vector3NegativeXAxis END (OK)");
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()
304 tlog.Debug(tag, $"Vector3NegativeYAxis START");
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.");
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!");
314 testingTarget.Dispose();
315 tlog.Debug(tag, $"Vector3NegativeYAxis END (OK)");
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()
327 tlog.Debug(tag, $"Vector3NegativeZAxis START");
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.");
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!");
337 testingTarget.Dispose();
338 tlog.Debug(tag, $"Vector3NegativeZAxis END (OK)");
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()
350 tlog.Debug(tag, $"Vector3Zero START");
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.");
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!");
360 testingTarget.Dispose();
361 tlog.Debug(tag, $"Vector3Zero END (OK)");
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()
373 tlog.Debug(tag, $"Vector3Length START");
375 using (Vector3 vector = new Vector3(0.0f, 0.0f, 0.0f))
377 Assert.AreEqual(0.0f, vector.Length(), "The length of vector is not correct!");
380 using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
382 Assert.AreEqual((float)Math.Sqrt(14.0f), vector.Length(), "The length of vector is not correct here!");
385 tlog.Debug(tag, $"Vector3Length END (OK)");
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()
397 tlog.Debug(tag, $"Vector3LengthSquared START");
399 using (Vector3 vector = new Vector3(0.0f, 0.0f, 0.0f))
401 Assert.AreEqual(0.0f, vector.LengthSquared(), "The length of vector is not correct!");
404 using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
406 Assert.AreEqual(14.0f, vector.LengthSquared(), "The length of vector is not correct here!");
409 tlog.Debug(tag, $"Vector3LengthSquared END (OK)");
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()
421 tlog.Debug(tag, $"Vector3Normalize START");
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))
426 Assert.Less(Math.Abs(1.0f - vector.LengthSquared()), 0.001f, "The value of LengthSquared is wrong");
429 using (Vector3 vector = new Vector3(0.0f, 0.0f, 0.0f))
432 Assert.Less(Math.Abs(0.0f - vector.LengthSquared()), 0.00001f, "Should be return 0.0f");
435 tlog.Debug(tag, $"Vector3Normalize END (OK)");
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()
447 tlog.Debug(tag, $"Vector3Clamp START");
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.");
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");
458 testingTarget.Dispose();
459 tlog.Debug(tag, $"Vector3Clamp END (OK)");
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()
471 tlog.Debug(tag, $"Vector3GetVectorXY START");
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.");
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!");
480 testingTarget.Dispose();
481 tlog.Debug(tag, $"Vector3GetVectorXY END (OK)");
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()
493 tlog.Debug(tag, $"Vector3GetVectorYZ START");
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.");
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!");
502 testingTarget.Dispose();
503 tlog.Debug(tag, $"Vector3GetVectorYZ END (OK)");
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")]
514 public void Vector3Width()
516 tlog.Debug(tag, $"Vector3Width START");
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.");
522 Assert.AreEqual(10.0f, testingTarget.Width, "The Width value of the vector is not correct!");
524 testingTarget.Width = 100.0f;
525 Assert.AreEqual(100.0f, testingTarget.Width, "The Width value of the vector is not correct here.");
527 testingTarget.Dispose();
528 tlog.Debug(tag, $"Vector3Width END (OK)");
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")]
540 public void Vector3Height()
542 tlog.Debug(tag, $"Vector3Height START");
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.");
548 Assert.AreEqual(20.0f, testingTarget.Height, "The Height value of the vector is not correct!");
550 testingTarget.Height = 100.0f;
551 Assert.AreEqual(100.0f, testingTarget.Height, "The Height value of the vector is not correct here.");
553 testingTarget.Dispose();
554 tlog.Debug(tag, $"Vector3Height END (OK)");
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")]
565 public void Vector3Depth()
567 tlog.Debug(tag, $"Vector3Depth START");
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.");
573 Assert.AreEqual(30.0f, testingTarget.Depth, "The Depth value of the vector is not correct!");
575 testingTarget.Depth = 100.0f;
576 Assert.AreEqual(100.0f, testingTarget.Depth, "The Depth value of the vector is not correct here.");
578 testingTarget.Dispose();
579 tlog.Debug(tag, $"Vector3Depth END (OK)");
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()
591 tlog.Debug(tag, $"Vector3GetR START");
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.");
597 Assert.AreEqual(10.0f, testingTarget.R, "The R value of the vector is not correct!");
599 testingTarget.Dispose();
600 tlog.Debug(tag, $"Vector3GetR END (OK)");
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()
612 tlog.Debug(tag, $"Vector3GetG START");
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.");
618 Assert.AreEqual(20.0f, testingTarget.G, "The G value of the vector is not correct!");
620 testingTarget.Dispose();
621 tlog.Debug(tag, $"Vector3GetG END (OK)");
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()
633 tlog.Debug(tag, $"Vector3GetB START");
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.");
639 Assert.AreEqual(30.0f, testingTarget.B, "The B value of the vector is not correct!");
641 testingTarget.Dispose();
642 tlog.Debug(tag, $"Vector3GetB END (OK)");
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()
653 tlog.Debug(tag, $"Vector3GetX START");
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.");
659 Assert.AreEqual(10.0f, testingTarget.X, "The X value of the vector is not correct!");
661 testingTarget.Dispose();
662 tlog.Debug(tag, $"Vector3GetX END (OK)");
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()
674 tlog.Debug(tag, $"Vector3GetY START");
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.");
680 Assert.AreEqual(20.0f, testingTarget.Y, "The Y value of the vector is not correct!");
682 testingTarget.Dispose();
683 tlog.Debug(tag, $"Vector3GetY END (OK)");
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()
695 tlog.Debug(tag, $"Vector3GetZ START");
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.");
701 Assert.AreEqual(30.0f, testingTarget.Z, "The Z value of the vector is not correct!");
703 testingTarget.Dispose();
704 tlog.Debug(tag, $"Vector3GetZ END (OK)");
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()
716 tlog.Debug(tag, $"Vector3Addition START");
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.");
722 using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
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!");
730 testingTarget.Dispose();
731 tlog.Debug(tag, $"Vector3Addition END (OK)");
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()
743 tlog.Debug(tag, $"Vector3Subtraction START");
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.");
749 using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
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!");
757 testingTarget.Dispose();
758 tlog.Debug(tag, $"Vector3Subtraction END (OK)");
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()
770 tlog.Debug(tag, $"Vector3UnaryNegation START");
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.");
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!");
781 testingTarget.Dispose();
782 tlog.Debug(tag, $"Vector3UnaryNegation END (OK)");
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()
795 tlog.Debug(tag, $"Vector3MultiplyByVector3 START");
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.");
801 using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
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!");
809 testingTarget.Dispose();
810 tlog.Debug(tag, $"Vector3MultiplyByVector3 END (OK)");
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()
823 tlog.Debug(tag, $"Vector3MultiplyByFloat START");
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.");
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!");
834 testingTarget.Dispose();
835 tlog.Debug(tag, $"Vector3MultiplyByFloat END (OK)");
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()
848 tlog.Debug(tag, $"Vector3DivisionByVector3 START");
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.");
854 using (Vector3 vector = new Vector3(1.0f, 2.0f, 3.0f))
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!");
862 testingTarget.Dispose();
863 tlog.Debug(tag, $"Vector3DivisionByVector3 END (OK)");
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()
876 tlog.Debug(tag, $"Vector3DivisionByFloat START");
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.");
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!");
887 testingTarget.Dispose();
888 tlog.Debug(tag, $"Vector3DivisionByFloat END (OK)");
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()
900 tlog.Debug(tag, $"Vector3Equals START");
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.");
906 using (Vector3 vector = new Vector3(1.0f, 1.0f, 1.0f))
908 var result = testingTarget.Equals(vector);
909 Assert.IsTrue(result, "Should be true here!");
912 testingTarget.Dispose();
913 tlog.Debug(tag, $"Vector3Equals END (OK)");
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()
925 tlog.Debug(tag, $"Vector3Dispose START");
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.");
933 testingTarget.Dispose();
937 Assert.Fail("Caught Exception" + e.ToString());
940 tlog.Debug(tag, $"Vector3Dispose END (OK)");
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()
952 tlog.Debug(tag, $"Vector3GetHashCode START");
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.");
958 var result = testingTarget.GetHashCode();
959 Assert.IsTrue(result >= Int32.MinValue && result <= Int32.MaxValue, "The value of hash is out of Integer range");
961 testingTarget.Dispose();
962 tlog.Debug(tag, $"Vector3GetHashCode END (OK)");