3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
7 namespace Tizen.NUI.Devel.Tests
9 using tlog = Tizen.Log;
12 [Description("Internal/Utility/ColorHistogram")]
13 public class InternalColorHistogramTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("ColorHistogram constructor.")]
32 [Property("SPEC", "Tizen.NUI.ColorHistogram.ColorHistogram C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void ColorHistogramConstructor()
38 tlog.Debug(tag, $"ColorHistogramConstructor START");
40 int[] pixels = new int[3] { 16, 4, 20 };
41 var testingTarget = new ColorHistogram(pixels);
42 Assert.IsNotNull(testingTarget, "Should be not null!");
43 Assert.IsInstanceOf<ColorHistogram>(testingTarget, "Should be an Instance of ColorHistogram!");
45 tlog.Debug(tag, $"ColorHistogramConstructor END (OK)");
50 [Description("ColorHistogram GetNumberOfColors.")]
51 [Property("SPEC", "Tizen.NUI.ColorHistogram.GetNumberOfColors M")]
52 [Property("SPEC_URL", "-")]
53 [Property("CRITERIA", "MR")]
54 [Property("AUTHOR", "guowei.wang@samsung.com")]
55 public void ColorHistogramGetNumberOfColors()
57 tlog.Debug(tag, $"ColorHistogramGetNumberOfColors START");
59 int[] pixels = new int[3] { 16, 4, 20 };
60 var testingTarget = new ColorHistogram(pixels);
61 Assert.IsNotNull(testingTarget, "Should be not null!");
62 Assert.IsInstanceOf<ColorHistogram>(testingTarget, "Should be an Instance of ColorHistogram!");
66 testingTarget.GetNumberOfColors();
67 tlog.Debug(tag, "numberColors :" + testingTarget.GetNumberOfColors());
71 tlog.Debug(tag, e.Message.ToString());
72 Assert.Fail("Caught Exception: Failed!");
75 tlog.Debug(tag, $"ColorHistogramGetNumberOfColors END (OK)");
80 [Description("ColorHistogram GetColors.")]
81 [Property("SPEC", "Tizen.NUI.ColorHistogram.GetColors M")]
82 [Property("SPEC_URL", "-")]
83 [Property("CRITERIA", "MR")]
84 [Property("AUTHOR", "guowei.wang@samsung.com")]
85 public void ColorHistogramGetColors()
87 tlog.Debug(tag, $"ColorHistogramGetColors START");
89 int[] pixels = new int[3] { 16, 4, 20 };
90 var testingTarget = new ColorHistogram(pixels);
91 Assert.IsNotNull(testingTarget, "Should be not null!");
92 Assert.IsInstanceOf<ColorHistogram>(testingTarget, "Should be an Instance of ColorHistogram!");
96 testingTarget.GetColors();
97 tlog.Debug(tag, "colors :" + testingTarget.GetColors());
101 tlog.Debug(tag, e.Message.ToString());
102 Assert.Fail("Caught Exception: Failed!");
105 tlog.Debug(tag, $"ColorHistogramGetColors END (OK)");
110 [Description("ColorHistogram GetColorCounts.")]
111 [Property("SPEC", "Tizen.NUI.ColorHistogram.GetColorCounts M")]
112 [Property("SPEC_URL", "-")]
113 [Property("CRITERIA", "MR")]
114 [Property("AUTHOR", "guowei.wang@samsung.com")]
115 public void ColorHistogramGetColorCounts()
117 tlog.Debug(tag, $"ColorHistogramGetColorCounts START");
119 int[] pixels = new int[3] { 16, 4, 20 };
120 var testingTarget = new ColorHistogram(pixels);
121 Assert.IsNotNull(testingTarget, "Should be not null!");
122 Assert.IsInstanceOf<ColorHistogram>(testingTarget, "Should be an Instance of ColorHistogram!");
126 testingTarget.GetColorCounts();
127 tlog.Debug(tag, "colorCounts :" + testingTarget.GetColorCounts());
131 tlog.Debug(tag, e.Message.ToString());
132 Assert.Fail("Caught Exception: Failed!");
135 tlog.Debug(tag, $"ColorHistogramGetColorCounts END (OK)");