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/Color")]
15 public class PublicColorTest
17 private const string tag = "NUITEST";
22 tlog.Info(tag, "Init() is called!");
28 tlog.Info(tag, "Destroy() is called!");
33 [Description("Color constructor.")]
34 [Property("SPEC", "Tizen.NUI.Color.Color C")]
35 [Property("SPEC_URL", "-")]
36 [Property("CRITERIA", "CONSTR")]
37 [Property("AUTHOR", "guowei.wang@samsung.com")]
38 public void ColorConstructor()
40 tlog.Debug(tag, $"ColorConstructor START");
42 var testingTarget = new Color();
43 Assert.IsNotNull(testingTarget, "null handle");
44 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
46 testingTarget.Dispose();
47 tlog.Debug(tag, $"ColorConstructor END (OK)");
52 [Description("Color constructor. With RGBA component.")]
53 [Property("SPEC", "Tizen.NUI.Color.Color C")]
54 [Property("SPEC_URL", "-")]
55 [Property("CRITERIA", "CONSTR")]
56 [Property("AUTHOR", "guowei.wang@samsung.com")]
57 public void ColorConstructorWithRGBAComponent()
59 tlog.Debug(tag, $"ColorConstructorWithRGBAComponent START");
61 var testingTarget = new Color(0.5f, 0.5f, 0.5f, 1.0f);
62 Assert.IsNotNull(testingTarget, "null handle");
63 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
65 Assert.AreEqual(0.5f, testingTarget.R, "The R property of Black is not correct here.");
66 Assert.AreEqual(0.5f, testingTarget.G, "The G property of Black is not correct here.");
67 Assert.AreEqual(0.5f, testingTarget.B, "The B property of Black is not correct here.");
68 Assert.AreEqual(1.0f, testingTarget.A, "The A property of Black is not correct here.");
70 testingTarget.Dispose();
71 tlog.Debug(tag, $"ColorConstructorWithRGBAComponent END (OK)");
76 [Description("Color constructor. With array.")]
77 [Property("SPEC", "Tizen.NUI.Color.Color C")]
78 [Property("SPEC_URL", "-")]
79 [Property("CRITERIA", "CONSTR")]
80 [Property("AUTHOR", "guowei.wang@samsung.com")]
81 public void ColorConstructorWithArray()
83 tlog.Debug(tag, $"ColorConstructorWithArray START");
85 float[] array = new float[4] { 0.5f, 0.5f, 0.5f, 1.0f };
87 var testingTarget = new Color(array);
88 Assert.IsNotNull(testingTarget, "null handle");
89 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
91 Assert.AreEqual(0.5f, testingTarget.R, "The R property of Black is not correct here.");
92 Assert.AreEqual(0.5f, testingTarget.G, "The G property of Black is not correct here.");
93 Assert.AreEqual(0.5f, testingTarget.B, "The B property of Black is not correct here.");
94 Assert.AreEqual(1.0f, testingTarget.A, "The A property of Black is not correct here.");
96 testingTarget.Dispose();
97 tlog.Debug(tag, $"ColorConstructorWithArray END (OK)");
102 [Description("Color constructor. With invalid value.")]
103 [Property("SPEC", "Tizen.NUI.Color.Color C")]
104 [Property("SPEC_URL", "-")]
105 [Property("CRITERIA", "CONSTR")]
106 [Property("AUTHOR", "guowei.wang@samsung.com")]
107 public void ColorConstructorWithInvalidValue()
109 tlog.Debug(tag, $"ColorConstructorWithInvalidValue START");
111 float[] array = new float[4] { 0.5f, 2.0f, 0.5f, 1.0f };
113 var testingTarget = new Color(array);
114 Assert.IsNotNull(testingTarget, "null handle");
115 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
117 Assert.AreEqual(0.5f, testingTarget.R, "The R property of Black is not correct here.");
118 Assert.AreEqual(1.0f, testingTarget.G, "The G property of Black is not correct here.");
119 Assert.AreEqual(0.5f, testingTarget.B, "The B property of Black is not correct here.");
120 Assert.AreEqual(1.0f, testingTarget.A, "The A property of Black is not correct here.");
122 testingTarget.Dispose();
123 tlog.Debug(tag, $"ColorConstructorWithInvalidValue END (OK)");
128 [Description("Color constructor. With null array.")]
129 [Property("SPEC", "Tizen.NUI.Color.Color C")]
130 [Property("SPEC_URL", "-")]
131 [Property("CRITERIA", "CONSTR")]
132 [Property("AUTHOR", "guowei.wang@samsung.com")]
133 public void ColorConstructorWithNullArray()
135 tlog.Debug(tag, $"ColorConstructorWithNullArray START");
137 float[] array = null;
141 var testingTarget = new Color(array);
142 Assert.Fail("Should return argument exception");
144 catch (ArgumentNullException)
146 tlog.Debug(tag, $"ColorConstructorWithNullArray END (OK)");
147 Assert.Pass("ArgumentException: passed!");
153 [Description("Color constructor. With string.")]
154 [Property("SPEC", "Tizen.NUI.Color.Color C")]
155 [Property("SPEC_URL", "-")]
156 [Property("CRITERIA", "CONSTR")]
157 [Property("AUTHOR", "guowei.wang@samsung.com")]
158 public void ColorConstructorWithString()
160 tlog.Debug(tag, $"ColorConstructorWithString START");
162 // Start with "#" && length is 8
163 var testingTarget = new Tizen.NUI.Color("#C3CAD2FF");
164 Assert.IsNotNull(testingTarget, "null handle");
165 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
167 // Start with "#" && length is 3
168 testingTarget = new Color("#047");
169 Assert.IsNotNull(testingTarget, "null handle");
170 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
172 // isRGBA && length is 4
173 testingTarget = new Color("RGBA(30,15,240,110)");
174 Assert.IsNotNull(testingTarget, "null handle");
175 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
177 // isRGB && length is 3
178 testingTarget = new Color("RGB(0,4,7)");
179 Assert.IsNotNull(testingTarget, "null handle");
180 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
182 testingTarget.Dispose();
183 tlog.Debug(tag, $"ColorConstructorWithString END (OK)");
188 [Description("Color constructor. String is null.")]
189 [Property("SPEC", "Tizen.NUI.Color.Color C")]
190 [Property("SPEC_URL", "-")]
191 [Property("CRITERIA", "CONSTR")]
192 [Property("AUTHOR", "guowei.wang@samsung.com")]
193 public void ColorConstructorWithNullString()
195 tlog.Debug(tag, $"ColorConstructorWithNullString START");
197 string textColor = null;
201 new Color(textColor);
202 Assert.Fail("Should return argument exception");
204 catch (ArgumentException)
206 tlog.Debug(tag, $"ColorConstructorWithNullString END (OK)");
207 Assert.Pass("ArgumentException: passed!");
213 [Description("Color constructor. With System.Drawing.Color instance.")]
214 [Property("SPEC", "Tizen.NUI.Color.Color C")]
215 [Property("SPEC_URL", "-")]
216 [Property("CRITERIA", "CONSTR")]
217 [Property("AUTHOR", "guowei.wang@samsung.com")]
218 public void ColorConstructorWithSystemDrawingColorInstance()
220 tlog.Debug(tag, $"ColorConstructorWithSystemDrawingColorInstance START");
222 global::System.Drawing.Color color = global::System.Drawing.Color.FromArgb(255, 0, 0);
224 var testingTarget = new Color(color);
225 Assert.IsNotNull(testingTarget, "null handle");
226 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
228 testingTarget.Dispose();
229 tlog.Debug(tag, $"ColorConstructorWithSystemDrawingColorInstance END (OK)");
234 [Description("Color R.")]
235 [Property("SPEC", "Tizen.NUI.Color.R A")]
236 [Property("SPEC_URL", "-")]
237 [Property("CRITERIA", "PRW")]
238 [Property("AUTHOR", "guowei.wang@samsung.com")]
241 tlog.Debug(tag, $"ColorR START");
243 var testingTarget = new Color(0.5f, 0.5f, 0.5f, 1.0f);
244 Assert.IsNotNull(testingTarget, "null handle");
245 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
247 Assert.AreEqual(0.5f, testingTarget.R, "The R property of color is not correct.");
249 testingTarget.R = 0.4f;
250 Assert.AreEqual(0.4f, testingTarget.R, "The R property of color is not correct here.");
252 testingTarget.Dispose();
253 tlog.Debug(tag, $"ColorR END (OK)");
258 [Description("Color G.")]
259 [Property("SPEC", "Tizen.NUI.Color.G A")]
260 [Property("SPEC_URL", "-")]
261 [Property("CRITERIA", "PRW")]
262 [Property("AUTHOR", "guowei.wang@samsung.com")]
265 tlog.Debug(tag, $"ColorG START");
267 var testingTarget = new Color(0.5f, 0.5f, 0.5f, 1.0f);
268 Assert.IsNotNull(testingTarget, "null handle");
269 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
271 Assert.AreEqual(0.5f, testingTarget.G, "The G property of color is not correct.");
273 testingTarget.G = 0.4f;
274 Assert.AreEqual(0.4f, testingTarget.G, "The G property of color is not correct here.");
276 testingTarget.Dispose();
277 tlog.Debug(tag, $"ColorG END (OK)");
282 [Description("Color B.")]
283 [Property("SPEC", "Tizen.NUI.Color.B A")]
284 [Property("SPEC_URL", "-")]
285 [Property("CRITERIA", "PRW")]
286 [Property("AUTHOR", "guowei.wang@samsung.com")]
289 tlog.Debug(tag, $"ColorB START");
291 var testingTarget = new Color(0.5f, 0.5f, 0.5f, 1.0f);
292 Assert.IsNotNull(testingTarget, "null handle");
293 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
295 Assert.AreEqual(0.5f, testingTarget.B, "The B property of color is not correct.");
297 testingTarget.B = 0.4f;
298 Assert.AreEqual(0.4f, testingTarget.B, "The B property of color is not correct here.");
300 testingTarget.Dispose();
301 tlog.Debug(tag, $"ColorB END (OK)");
306 [Description("Color A.")]
307 [Property("SPEC", "Tizen.NUI.Color.A A")]
308 [Property("SPEC_URL", "-")]
309 [Property("CRITERIA", "PRW")]
310 [Property("AUTHOR", "guowei.wang@samsung.com")]
313 tlog.Debug(tag, $"ColorA START");
315 var testingTarget = new Color(0.5f, 0.5f, 0.5f, 1.0f);
316 Assert.IsNotNull(testingTarget, "null handle");
317 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
319 Assert.AreEqual(1.0f, testingTarget.A, "The A property of color is not correct.");
321 testingTarget.A = 0.4f;
322 Assert.AreEqual(0.4f, testingTarget.A, "The A property of color is not correct here.");
324 testingTarget.Dispose();
325 tlog.Debug(tag, $"ColorA END (OK)");
330 [Description("Color AliceBlue.")]
331 [Property("SPEC", "Tizen.NUI.Color.AliceBlue A")]
332 [Property("SPEC_URL", "-")]
333 [Property("CRITERIA", "PRO")]
334 [Property("AUTHOR", "guowei.wang@samsung.com")]
335 public void ColorAliceBlue()
337 tlog.Debug(tag, $"ColorAliceBlue START");
339 var testingTarget = Color.AliceBlue;
340 Assert.IsNotNull(testingTarget, "null handle");
341 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
343 testingTarget.Dispose();
344 tlog.Debug(tag, $"ColorAliceBlue END (OK)");
349 [Description("Color Aqua.")]
350 [Property("SPEC", "Tizen.NUI.Color.Aqua A")]
351 [Property("SPEC_URL", "-")]
352 [Property("CRITERIA", "PRO")]
353 [Property("AUTHOR", "guowei.wang@samsung.com")]
354 public void ColorAqua()
356 tlog.Debug(tag, $"ColorAqua START");
358 var testingTarget = Color.Aqua;
359 Assert.IsNotNull(testingTarget, "null handle");
360 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
362 testingTarget.Dispose();
363 tlog.Debug(tag, $"ColorAqua END (OK)");
368 [Description("Color Azure.")]
369 [Property("SPEC", "Tizen.NUI.Color.Azure A")]
370 [Property("SPEC_URL", "-")]
371 [Property("CRITERIA", "PRO")]
372 [Property("AUTHOR", "guowei.wang@samsung.com")]
373 public void ColorAzure()
375 tlog.Debug(tag, $"ColorAzure START");
377 var testingTarget = Color.Azure;
378 Assert.IsNotNull(testingTarget, "null handle");
379 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
381 testingTarget.Dispose();
382 tlog.Debug(tag, $"ColorAzure END (OK)");
387 [Description("Color Beige.")]
388 [Property("SPEC", "Tizen.NUI.Color.Beige A")]
389 [Property("SPEC_URL", "-")]
390 [Property("CRITERIA", "PRO")]
391 [Property("AUTHOR", "guowei.wang@samsung.com")]
392 public void ColorBeige()
394 tlog.Debug(tag, $"ColorBeige START");
396 var testingTarget = Color.Beige;
397 Assert.IsNotNull(testingTarget, "null handle");
398 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
400 testingTarget.Dispose();
401 tlog.Debug(tag, $"ColorBeige END (OK)");
406 [Description("Color Black.")]
407 [Property("SPEC", "Tizen.NUI.Color.Black A")]
408 [Property("SPEC_URL", "-")]
409 [Property("CRITERIA", "PRO")]
410 [Property("AUTHOR", "guowei.wang@samsung.com")]
411 public void ColorBlack()
413 tlog.Debug(tag, $"ColorBlack START");
415 var testingTarget = Color.Black;
416 Assert.IsNotNull(testingTarget, "null handle");
417 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
419 Assert.AreEqual(0.0f, testingTarget.R, "The R property of Black is not correct here.");
420 Assert.AreEqual(0.0f, testingTarget.G, "The G property of Black is not correct here.");
421 Assert.AreEqual(0.0f, testingTarget.B, "The B property of Black is not correct here.");
422 Assert.AreEqual(1.0f, testingTarget.A, "The A property of Black is not correct here.");
424 testingTarget.Dispose();
425 tlog.Debug(tag, $"ColorBlack END (OK)");
430 [Description("Color Blue.")]
431 [Property("SPEC", "Tizen.NUI.Color.Blue A")]
432 [Property("SPEC_URL", "-")]
433 [Property("CRITERIA", "PRO")]
434 [Property("AUTHOR", "guowei.wang@samsung.com")]
435 public void ColorBlue()
437 tlog.Debug(tag, $"ColorBlue START");
439 var testingTarget = Color.Blue;
440 Assert.IsNotNull(testingTarget, "null handle");
441 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
443 Assert.AreEqual(0.0f, testingTarget.R, "The R property of Blue is not correct here.");
444 Assert.AreEqual(0.0f, testingTarget.G, "The G property of Blue is not correct here.");
445 Assert.AreEqual(1.0f, testingTarget.B, "The B property of Blue is not correct here.");
446 Assert.AreEqual(1.0f, testingTarget.A, "The A property of Blue is not correct here.");
448 testingTarget.Dispose();
449 tlog.Debug(tag, $"ColorBlue END (OK)");
454 [Description("Color Chocolate.")]
455 [Property("SPEC", "Tizen.NUI.Color.Chocolate A")]
456 [Property("SPEC_URL", "-")]
457 [Property("CRITERIA", "PRO")]
458 [Property("AUTHOR", "guowei.wang@samsung.com")]
459 public void ColorChocolate()
461 tlog.Debug(tag, $"ColorChocolate START");
463 var testingTarget = Color.Chocolate;
464 Assert.IsNotNull(testingTarget, "null handle");
465 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
467 testingTarget.Dispose();
468 tlog.Debug(tag, $"ColorChocolate END (OK)");
473 [Description("Color Cornsilk.")]
474 [Property("SPEC", "Tizen.NUI.Color.Cornsilk A")]
475 [Property("SPEC_URL", "-")]
476 [Property("CRITERIA", "PRO")]
477 [Property("AUTHOR", "guowei.wang@samsung.com")]
478 public void ColorCornsilk()
480 tlog.Debug(tag, $"ColorCornsilk START");
482 var testingTarget = Color.Cornsilk;
483 Assert.IsNotNull(testingTarget, "null handle");
484 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
486 testingTarget.Dispose();
487 tlog.Debug(tag, $"ColorCornsilk END (OK)");
492 [Description("Color Crimson.")]
493 [Property("SPEC", "Tizen.NUI.Color.Crimson A")]
494 [Property("SPEC_URL", "-")]
495 [Property("CRITERIA", "PRO")]
496 [Property("AUTHOR", "guowei.wang@samsung.com")]
497 public void ColorCrimson()
499 tlog.Debug(tag, $"ColorCrimson START");
501 var testingTarget = Color.Crimson;
502 Assert.IsNotNull(testingTarget, "null handle");
503 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
505 testingTarget.Dispose();
506 tlog.Debug(tag, $"ColorCrimson END (OK)");
511 [Description("Color Cyan.")]
512 [Property("SPEC", "Tizen.NUI.Color.Cyan A")]
513 [Property("SPEC_URL", "-")]
514 [Property("CRITERIA", "PRO")]
515 [Property("AUTHOR", "guowei.wang@samsung.com")]
516 public void ColorCyan()
518 tlog.Debug(tag, $"ColorCyan START");
520 var testingTarget = Color.Cyan;
521 Assert.IsNotNull(testingTarget, "null handle");
522 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
524 Assert.AreEqual(0.0f, testingTarget.R, "The R property of Cyan is not correct here.");
525 Assert.AreEqual(1.0f, testingTarget.G, "The G property of Cyan is not correct here.");
526 Assert.AreEqual(1.0f, testingTarget.B, "The B property of Cyan is not correct here.");
527 Assert.AreEqual(1.0f, testingTarget.A, "The A property of Cyan is not correct here.");
529 testingTarget.Dispose();
530 tlog.Debug(tag, $"ColorCyan END (OK)");
535 [Description("Color DarkGray.")]
536 [Property("SPEC", "Tizen.NUI.Color.DarkGray A")]
537 [Property("SPEC_URL", "-")]
538 [Property("CRITERIA", "PRO")]
539 [Property("AUTHOR", "guowei.wang@samsung.com")]
540 public void ColorDarkGray()
542 tlog.Debug(tag, $"ColorDarkGray START");
544 var testingTarget = Color.DarkGray;
545 Assert.IsNotNull(testingTarget, "null handle");
546 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
548 Assert.AreEqual(0.6627451f, testingTarget.R, "The R property of DarkGray is not correct here.");
549 Assert.AreEqual(0.6627451f, testingTarget.G, "The G property of DarkGray is not correct here.");
550 Assert.AreEqual(0.6627451f, testingTarget.B, "The B property of DarkGray is not correct here.");
551 Assert.AreEqual(1.0f, testingTarget.A, "The A property of DarkGray is not correct here.");
553 testingTarget.Dispose();
554 tlog.Debug(tag, $"ColorDarkGray END (OK)");
559 [Description("Color DarkGreen.")]
560 [Property("SPEC", "Tizen.NUI.Color.DarkGreen A")]
561 [Property("SPEC_URL", "-")]
562 [Property("CRITERIA", "PRO")]
563 [Property("AUTHOR", "guowei.wang@samsung.com")]
564 public void ColorDarkGreen()
566 tlog.Debug(tag, $"ColorDarkGreen START");
568 var testingTarget = Color.DarkGreen;
569 Assert.IsNotNull(testingTarget, "null handle");
570 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
572 testingTarget.Dispose();
573 tlog.Debug(tag, $"ColorDarkGreen END (OK)");
578 [Description("Color DarkOrange.")]
579 [Property("SPEC", "Tizen.NUI.Color.DarkOrange A")]
580 [Property("SPEC_URL", "-")]
581 [Property("CRITERIA", "PRO")]
582 [Property("AUTHOR", "guowei.wang@samsung.com")]
583 public void ColorDarkOrange()
585 tlog.Debug(tag, $"ColorDarkOrange START");
587 var testingTarget = Color.DarkOrange;
588 Assert.IsNotNull(testingTarget, "null handle");
589 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
591 testingTarget.Dispose();
592 tlog.Debug(tag, $"ColorDarkOrange END (OK)");
597 [Description("Color DarkOrchid.")]
598 [Property("SPEC", "Tizen.NUI.Color.DarkOrchid A")]
599 [Property("SPEC_URL", "-")]
600 [Property("CRITERIA", "PRO")]
601 [Property("AUTHOR", "guowei.wang@samsung.com")]
602 public void ColorDarkOrchid()
604 tlog.Debug(tag, $"ColorDarkOrchid START");
606 var testingTarget = Color.DarkOrchid;
607 Assert.IsNotNull(testingTarget, "null handle");
608 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
610 testingTarget.Dispose();
611 tlog.Debug(tag, $"ColorDarkOrchid END (OK)");
616 [Description("Color White.")]
617 [Property("SPEC", "Tizen.NUI.Color.White A")]
618 [Property("SPEC_URL", "-")]
619 [Property("CRITERIA", "PRO")]
620 [Property("AUTHOR", "guowei.wang@samsung.com")]
621 public void ColorWhite()
623 tlog.Debug(tag, $"ColorWhite START");
625 var testingTarget = Color.White;
626 Assert.IsNotNull(testingTarget, "null handle");
627 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
629 Assert.AreEqual(1.0f, testingTarget.R, "The R property of White is not correct here.");
630 Assert.AreEqual(1.0f, testingTarget.G, "The G property of White is not correct here.");
631 Assert.AreEqual(1.0f, testingTarget.B, "The B property of White is not correct here.");
632 Assert.AreEqual(1.0f, testingTarget.A, "The A property of White is not correct here.");
634 testingTarget.Dispose();
635 tlog.Debug(tag, $"ColorWhite END (OK)");
640 [Description("Color Red.")]
641 [Property("SPEC", "Tizen.NUI.Color.Red A")]
642 [Property("SPEC_URL", "-")]
643 [Property("CRITERIA", "PRO")]
644 [Property("AUTHOR", "guowei.wang@samsung.com")]
645 public void ColorRed()
647 tlog.Debug(tag, $"ColorRed START");
649 var testingTarget = Color.Red;
650 Assert.IsNotNull(testingTarget, "null handle");
651 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
653 Assert.AreEqual(1.0f, testingTarget.R, "The R property of Red is not correct here.");
654 Assert.AreEqual(0.0f, testingTarget.G, "The G property of Red is not correct here.");
655 Assert.AreEqual(0.0f, testingTarget.B, "The B property of Red is not correct here.");
656 Assert.AreEqual(1.0f, testingTarget.A, "The A property of Red is not correct here.");
658 testingTarget.Dispose();
659 tlog.Debug(tag, $"ColorRed END (OK)");
664 [Description("Color Green.")]
665 [Property("SPEC", "Tizen.NUI.Color.Green A")]
666 [Property("SPEC_URL", "-")]
667 [Property("CRITERIA", "PRO")]
668 [Property("AUTHOR", "guowei.wang@samsung.com")]
669 public void ColorGreen()
671 tlog.Debug(tag, $"ColorGreen START");
673 var testingTarget = Color.Green;
674 Assert.IsNotNull(testingTarget, "null handle");
675 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
677 Assert.AreEqual(0.0f, testingTarget.R, "The R property of Green is not correct here.");
678 Assert.AreEqual(1.0f, testingTarget.G, "The G property of Green is not correct here.");
679 Assert.AreEqual(0.0f, testingTarget.B, "The B property of Green is not correct here.");
680 Assert.AreEqual(1.0f, testingTarget.A, "The A property of Green is not correct here.");
682 testingTarget.Dispose();
683 tlog.Debug(tag, $"ColorGreen END (OK)");
688 [Description("Color Yellow.")]
689 [Property("SPEC", "Tizen.NUI.Color.Yellow A")]
690 [Property("SPEC_URL", "-")]
691 [Property("CRITERIA", "PRO")]
692 [Property("AUTHOR", "guowei.wang@samsung.com")]
693 public void ColorYellow()
695 tlog.Debug(tag, $"ColorYellow START");
697 var testingTarget = Color.Yellow;
698 Assert.IsNotNull(testingTarget, "null handle");
699 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
701 Assert.AreEqual(1.0f, testingTarget.R, "The R property of Yellow is not correct here.");
702 Assert.AreEqual(1.0f, testingTarget.G, "The G property of Yellow is not correct here.");
703 Assert.AreEqual(0.0f, testingTarget.B, "The B property of Yellow is not correct here.");
704 Assert.AreEqual(1.0f, testingTarget.A, "The A property of Yellow is not correct here.");
706 testingTarget.Dispose();
707 tlog.Debug(tag, $"ColorYellow END (OK)");
712 [Description("Color Magenta.")]
713 [Property("SPEC", "Tizen.NUI.Color.Magenta A")]
714 [Property("SPEC_URL", "-")]
715 [Property("CRITERIA", "PRO")]
716 [Property("AUTHOR", "guowei.wang@samsung.com")]
717 public void ColorMagenta()
719 tlog.Debug(tag, $"ColorMagenta START");
721 var testingTarget = Color.Magenta;
722 Assert.IsNotNull(testingTarget, "null handle");
723 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
725 Assert.AreEqual(1.0f, testingTarget.R, "The R property of Magenta is not correct here.");
726 Assert.AreEqual(0.0f, testingTarget.G, "The G property of Magenta is not correct here.");
727 Assert.AreEqual(1.0f, testingTarget.B, "The B property of Magenta is not correct here.");
728 Assert.AreEqual(1.0f, testingTarget.A, "The A property of Magenta is not correct here.");
730 testingTarget.Dispose();
731 tlog.Debug(tag, $"ColorMagenta END (OK)");
736 [Description("Color Transparent.")]
737 [Property("SPEC", "Tizen.NUI.Color.Transparent A")]
738 [Property("SPEC_URL", "-")]
739 [Property("CRITERIA", "PRO")]
740 [Property("AUTHOR", "guowei.wang@samsung.com")]
741 public void ColorTransparent()
743 tlog.Debug(tag, $"ColorTransparent START");
745 var testingTarget = Color.Transparent;
746 Assert.IsNotNull(testingTarget, "null handle");
747 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
749 Assert.AreEqual(0.0f, testingTarget.R, "The R property of Transparent is not correct here.");
750 Assert.AreEqual(0.0f, testingTarget.G, "The G property of Transparent is not correct here.");
751 Assert.AreEqual(0.0f, testingTarget.B, "The B property of Transparent is not correct here.");
752 Assert.AreEqual(0.0f, testingTarget.A, "The A property of Transparent is not correct here.");
754 testingTarget.Dispose();
755 tlog.Debug(tag, $"ColorTransparent END (OK)");
760 [Description("Color this[uint index]. Get value by subscript.")]
761 [Property("SPEC", "Tizen.NUI.Color.this[uint] A")]
762 [Property("SPEC_URL", "-")]
763 [Property("CRITERIA", "PRO")]
764 [Property("AUTHOR", "guowei.wang@samsung.com")]
765 public void ColorGetValueBySubscript()
767 tlog.Debug(tag, $"ColorGetValueBySubscript START");
769 var testingTarget = new Color(0.1f, 0.2f, 0.3f, 0.4f);
770 Assert.IsNotNull(testingTarget, "null handle");
771 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
773 Assert.AreEqual(0.1f, testingTarget[0], "The value of index[0] is not correct!");
774 Assert.AreEqual(0.2f, testingTarget[1], "The value of index[1] is not correct!");
775 Assert.AreEqual(0.3f, testingTarget[2], "The value of index[2] is not correct!");
776 Assert.AreEqual(0.4f, testingTarget[3], "The value of index[3] is not correct!");
778 testingTarget.Dispose();
779 tlog.Debug(tag, $"ColorGetValueBySubscript END (OK)");
784 [Description("Color operator +.")]
785 [Property("SPEC", "Tizen.NUI.Color.+ M")]
786 [Property("SPEC_URL", "-")]
787 [Property("CRITERIA", "MR")]
788 [Property("AUTHOR", "guowei.wang@samsung.com")]
789 public void ColorAddition()
791 tlog.Debug(tag, $"ColorAddition START");
793 Color color1 = new Color(0.1f, 0.2f, 0.3f, 0.4f);
794 Color color2 = new Color(0.4f, 0.3f, 0.5f, 0.6f);
796 var testingTarget = color1 + color2;
797 Assert.IsNotNull(testingTarget, "null handle");
798 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
800 Assert.AreEqual(0.5f, testingTarget.R, "The R value of the color is not correct!");
801 Assert.AreEqual(0.5f, testingTarget.G, "The G value of the color is not correct!");
802 Assert.AreEqual(0.8f, testingTarget.B, "The B value of the color is not correct!");
803 Assert.AreEqual(1.0f, testingTarget.A, "The A value of the color is not correct!");
807 testingTarget.Dispose();
808 tlog.Debug(tag, $"ColorAddition END (OK)");
813 [Description("Color operator -.")]
814 [Property("SPEC", "Tizen.NUI.Color.- M")]
815 [Property("SPEC_URL", "-")]
816 [Property("CRITERIA", "MR")]
817 [Property("AUTHOR", "guowei.wang@samsung.com")]
818 public void ColorSubtraction()
820 tlog.Debug(tag, $"ColorSubtraction START");
822 Color color1 = new Color(0.1f, 0.2f, 0.3f, 0.4f);
823 Color color2 = new Color(0.4f, 0.3f, 0.5f, 0.6f);
825 var testingTarget = color2 - color1;
826 Assert.IsNotNull(testingTarget, "null handle");
827 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
829 Assert.Less(Math.Abs(0.3f - testingTarget.R), 0.001f, "The R value of the color is not correct!");
830 Assert.Less(Math.Abs(0.1f - testingTarget.G), 0.001f, "The G value of the color is not correct!");
831 Assert.Less(Math.Abs(0.2f - testingTarget.B), 0.001f, "The B value of the color is not correct!");
832 Assert.Less(Math.Abs(0.2f - testingTarget.A), 0.001f, "The A value of the color is not correct!");
836 testingTarget.Dispose();
837 tlog.Debug(tag, $"ColorSubtraction END (OK)");
842 [Description("Color Unary Negation.")]
843 [Property("SPEC", "Tizen.NUI.Color.UnaryNegation M")]
844 [Property("SPEC_URL", "-")]
845 [Property("CRITERIA", "MR")]
846 [Property("AUTHOR", "guowei.wang@samsung.com")]
847 public void ColorUnaryNegation()
849 tlog.Debug(tag, $"ColorUnaryNegation START");
851 Color color = new Color(0.1f, 0.2f, 0.3f, 0.4f);
853 var testingTarget = -color;
854 Assert.IsNotNull(testingTarget, "null handle");
855 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
857 Assert.AreEqual(0.0f, testingTarget.R, "The R value of the color is not correct!");
858 Assert.AreEqual(0.0f, testingTarget.G, "The G value of the color is not correct!");
859 Assert.AreEqual(0.0f, testingTarget.B, "The B value of the color is not correct!");
860 Assert.AreEqual(0.0f, testingTarget.A, "The A value of the color is not correct!");
863 testingTarget.Dispose();
864 tlog.Debug(tag, $"ColorUnaryNegation END (OK)");
869 [Description("Color operator *.")]
870 [Property("SPEC", "Tizen.NUI.Color.* M")]
871 [Property("SPEC_URL", "-")]
872 [Property("CRITERIA", "MR")]
873 [Property("AUTHOR", "guowei.wang@samsung.com")]
874 public void ColorMultiply()
876 tlog.Debug(tag, $"ColorMultiply START");
878 Color color1 = new Color(0.1f, 0.2f, 0.3f, 0.1f);
879 Color color2 = new Color(0.4f, 0.3f, 0.2f, 0.6f);
881 var testingTarget = color2 * color1;
882 Assert.IsNotNull(testingTarget, "null handle");
883 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
885 Assert.AreEqual(0.04f, testingTarget.R, 0.00001, "The R value of the color is not correct!");
886 Assert.AreEqual(0.06f, testingTarget.G, 0.00001, "The G value of the color is not correct!");
887 Assert.AreEqual(0.06f, testingTarget.B, 0.00001, "The B value of the color is not correct!");
888 Assert.AreEqual(0.06f, testingTarget.A, 0.00001, "The A value of the color is not correct!");
892 testingTarget.Dispose();
893 tlog.Debug(tag, $"ColorMultiply END (OK)");
898 [Description("Color operator *. By float.")]
899 [Property("SPEC", "Tizen.NUI.Color.* M")]
900 [Property("SPEC_URL", "-")]
901 [Property("CRITERIA", "MR")]
902 [Property("AUTHOR", "guowei.wang@samsung.com")]
903 public void ColorMultiplyByFloat()
905 tlog.Debug(tag, $"ColorMultiplyByFloat START");
907 Color color = new Color(0.1f, 0.2f, 0.3f, 0.1f);
909 var testingTarget = color * 2.0f;
910 Assert.IsNotNull(testingTarget, "null handle");
911 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
913 Assert.Less(Math.Abs(0.2f - testingTarget.R), 0.001f, "The R value of the color is not correct!");
914 Assert.Less(Math.Abs(0.4f - testingTarget.G), 0.001f, "The G value of the color is not correct!");
915 Assert.Less(Math.Abs(0.6f - testingTarget.B), 0.001f, "The B value of the color is not correct!");
916 Assert.Less(Math.Abs(0.2f - testingTarget.A), 0.001f, "The A value of the color is not correct!");
919 testingTarget.Dispose();
920 tlog.Debug(tag, $"ColorMultiplyByFloat END (OK)");
925 [Description("Color operator /.")]
926 [Property("SPEC", "Tizen.NUI.Color./ M")]
927 [Property("SPEC_URL", "-")]
928 [Property("CRITERIA", "MR")]
929 [Property("AUTHOR", "guowei.wang@samsung.com")]
930 public void ColorDivision()
932 tlog.Debug(tag, $"ColorDivision START");
934 Color color1 = new Color(0.2f, 0.2f, 0.3f, 0.1f);
935 Color color2 = new Color(0.04f, 0.06f, 0.06f, 0.06f);
937 Color testingTarget = color2 / color1;
938 Assert.IsNotNull(testingTarget, "null handle");
939 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
941 Assert.Less(Math.Abs(0.2f - testingTarget.R), 0.001f, "The R value of the color is not correct!");
942 Assert.Less(Math.Abs(0.3f - testingTarget.G), 0.001f, "The G value of the color is not correct!");
943 Assert.Less(Math.Abs(0.2f - testingTarget.B), 0.001f, "The B value of the color is not correct!");
944 Assert.Less(Math.Abs(0.6f - testingTarget.A), 0.001f, "The A value of the color is not correct!");
948 testingTarget.Dispose();
949 tlog.Debug(tag, $"ColorDivision END (OK)");
954 [Description("Color EqualTo.")]
955 [Property("SPEC", "Tizen.NUI.Color.EqualTo M")]
956 [Property("SPEC_URL", "-")]
957 [Property("CRITERIA", "MR")]
958 [Property("AUTHOR", "guowei.wang@samsung.com")]
959 public void ColorEqualTo()
961 tlog.Debug(tag, $"ColorEqualTo START");
963 var testingTarget = new Color(0.1f, 0.2f, 0.3f, 0.4f);
964 Assert.IsNotNull(testingTarget, "null handle");
965 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
967 using (Color color = new Color(0.1f, 0.2f, 0.3f, 0.4f))
969 Assert.IsTrue((testingTarget.EqualTo(color)), "Should be equal");
972 testingTarget.Dispose();
973 tlog.Debug(tag, $"ColorEqualTo END (OK)");
978 [Description("Color NotEqualTo.")]
979 [Property("SPEC", "Tizen.NUI.Color.NotEqualTo M")]
980 [Property("SPEC_URL", "-")]
981 [Property("CRITERIA", "MR")]
982 [Property("AUTHOR", "guowei.wang@samsung.com")]
983 public void ColorNotEqualTo()
985 tlog.Debug(tag, $"ColorNotEqualTo START");
987 var testingTarget = new Color(0.1f, 0.2f, 0.3f, 0.4f);
988 Assert.IsNotNull(testingTarget, "null handle");
989 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
991 using (Color color = new Color(0.4f, 0.3f, 0.2f, 0.1f))
993 Assert.IsTrue((testingTarget.NotEqualTo(color)), "Should be equal");
996 testingTarget.Dispose();
997 tlog.Debug(tag, $"ColorNotEqualTo END (OK)");
1002 [Description("Color implicit. Vector4 to color.")]
1003 [Property("SPEC", "Tizen.NUI.Color.implicit M")]
1004 [Property("SPEC_URL", "-")]
1005 [Property("CRITERIA", "MR")]
1006 [Property("AUTHOR", "guowei.wang@samsung.com")]
1007 public void ColorImplicitConvertFromVector4()
1009 tlog.Debug(tag, $"ColorImplicitConvertFromVector4 START");
1011 Color testingTarget = null;
1012 using (Vector4 vector = new Vector4(0.1f, 0.2f, 0.3f, 0.4f))
1014 testingTarget = vector;
1015 Assert.AreEqual(testingTarget.R, vector.R, "The value of R is not correct.");
1016 Assert.AreEqual(testingTarget.G, vector.G, "The value of G is not correct.");
1017 Assert.AreEqual(testingTarget.B, vector.B, "The value of B is not correct.");
1018 Assert.AreEqual(testingTarget.A, vector.A, "The value of A is not correct.");
1021 testingTarget.Dispose();
1022 tlog.Debug(tag, $"ColorImplicitConvertFromVector4 END (OK)");
1027 [Description("Color implicit. Color to vector4.")]
1028 [Property("SPEC", "Tizen.NUI.Color.implicit M")]
1029 [Property("SPEC_URL", "-")]
1030 [Property("CRITERIA", "MR")]
1031 [Property("AUTHOR", "guowei.wang@samsung.com")]
1032 public void ColorImplicitConvertToVector4()
1034 tlog.Debug(tag, $"ColorImplicitConvertToVector4 START");
1036 Vector4 testingTarget = null;
1037 using (Color color = new Color(0.1f, 0.2f, 0.3f, 0.4f))
1039 testingTarget = color;
1040 Assert.AreEqual(color.R, testingTarget.R, "The value of R is not correct.");
1041 Assert.AreEqual(color.G, testingTarget.G, "The value of G is not correct.");
1042 Assert.AreEqual(color.B, testingTarget.B, "The value of B is not correct.");
1043 Assert.AreEqual(color.A, testingTarget.A, "The value of A is not correct.");
1046 testingTarget.Dispose();
1047 tlog.Debug(tag, $"ColorImplicitConvertToVector4 END (OK)");
1052 [Description("Color GetHashCode.")]
1053 [Property("SPEC", "Tizen.NUI.Color.GetHashCode M")]
1054 [Property("SPEC_URL", "-")]
1055 [Property("CRITERIA", "MR")]
1056 [Property("AUTHOR", "guowei.wang@samsung.com")]
1057 public void ColorGetHashCode()
1059 tlog.Debug(tag, $"ColorGetHashCode START");
1061 var testingTarget = new Color(0.1f, 0.3f, 0.4f, 0.8f);
1062 Assert.IsNotNull(testingTarget, "null handle");
1063 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
1065 var result = testingTarget.GetHashCode();
1066 tlog.Debug(tag, "GetHashCode : " + result);
1068 testingTarget.Dispose();
1069 tlog.Debug(tag, $"ColorGetHashCode END (OK)");
1074 [Description("Color Equals.")]
1075 [Property("SPEC", "Tizen.NUI.Color.Equals M")]
1076 [Property("SPEC_URL", "-")]
1077 [Property("CRITERIA", "MR")]
1078 [Property("AUTHOR", "guowei.wang@samsung.com")]
1079 public void ColorEquals()
1081 tlog.Debug(tag, $"ColorEquals START");
1083 var testingTarget = new Color(0.1f, 0.3f, 0.4f, 0.8f);
1084 Assert.IsNotNull(testingTarget, "null handle");
1085 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
1087 using (Size size = new Size(20, 30))
1089 var result = testingTarget.Equals(size);
1090 Assert.IsFalse(result);
1093 using (Color color = testingTarget)
1095 var result = testingTarget.Equals(color);
1096 Assert.IsTrue(result);
1099 testingTarget.Dispose();
1100 tlog.Debug(tag, $"ColorEquals END (OK)");
1105 [Description("Color Equals. With null object")]
1106 [Property("SPEC", "Tizen.NUI.Color.Equals M")]
1107 [Property("SPEC_URL", "-")]
1108 [Property("CRITERIA", "MR")]
1109 [Property("AUTHOR", "guowei.wang@samsung.com")]
1110 public void ColorEqualsWithNullObject()
1112 tlog.Debug(tag, $"ColorEqualsWithNullObject START");
1114 var testingTarget = new Color(0.1f, 0.3f, 0.4f, 0.8f);
1115 Assert.IsNotNull(testingTarget, "null handle");
1116 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
1118 var result = testingTarget.Equals(null);
1119 Assert.IsFalse(result);
1121 testingTarget.Dispose();
1122 tlog.Debug(tag, $"ColorEqualsWithNullObject END (OK)");
1127 [Description("Color GetColorFromPtr.")]
1128 [Property("SPEC", "Tizen.NUI.Color.Equals M")]
1129 [Property("SPEC_URL", "-")]
1130 [Property("CRITERIA", "MR")]
1131 [Property("AUTHOR", "guowei.wang@samsung.com")]
1132 public void ColorGetColorFromPtr()
1134 tlog.Debug(tag, $"ColorGetColorFromPtr START");
1136 using (Color color = Color.Cyan)
1138 var testingTarget = Color.GetColorFromPtr(color.SwigCPtr.Handle);
1139 Assert.IsNotNull(testingTarget, "null handle");
1140 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
1142 testingTarget.Dispose();
1145 tlog.Debug(tag, $"ColorGetColorFromPtr END (OK)");
1150 [Description("Color Dispose.")]
1151 [Property("SPEC", "Tizen.NUI.Color.Dispose M")]
1152 [Property("SPEC_URL", "-")]
1153 [Property("CRITERIA", "MR MCST")]
1154 [Property("AUTHOR", "guowei.wang@samsung.com")]
1155 public void ColorDispose()
1157 tlog.Debug(tag, $"ColorDispose START");
1159 var testingTarget = new Color();
1160 Assert.IsNotNull(testingTarget, "null handle");
1161 Assert.IsInstanceOf<Color>(testingTarget, "Should return Color instance.");
1165 testingTarget.Dispose();
1169 Assert.Fail("Caught Exception" + e.ToString());
1172 tlog.Debug(tag, $"ColorDispose END (OK)");