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/Common/AngleThresholdPair")]
13 public class InternalAngleThresholdPairTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("AngleThresholdPair constructor.")]
32 [Property("SPEC", "Tizen.NUI.AngleThresholdPair.AngleThresholdPair C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void AngleThresholdPairConstructor()
38 tlog.Debug(tag, $"AngleThresholdPairConstructor START");
40 var testingTarget = new AngleThresholdPair();
41 Assert.IsNotNull(testingTarget, "Can't create success object AngleThresholdPair");
42 Assert.IsInstanceOf<AngleThresholdPair>(testingTarget, "Should be an instance of AngleThresholdPair type.");
44 testingTarget.Dispose();
45 tlog.Debug(tag, $"AngleThresholdPairConstructor END (OK)");
50 [Description("AngleThresholdPair constructor. With Radians.")]
51 [Property("SPEC", "Tizen.NUI.AngleThresholdPair.AngleThresholdPair C")]
52 [Property("SPEC_URL", "-")]
53 [Property("CRITERIA", "CONSTR")]
54 [Property("AUTHOR", "guowei.wang@samsung.com")]
55 public void AngleThresholdPairConstructorWithRadians()
57 tlog.Debug(tag, $"AngleThresholdPairConstructorWithRadians START");
59 using (Radian t = new Radian(0.3f))
61 using (Radian u = new Radian(0.8f))
63 var testingTarget = new AngleThresholdPair(t, u);
64 Assert.IsNotNull(testingTarget, "Can't create success object AngleThresholdPair");
65 Assert.IsInstanceOf<AngleThresholdPair>(testingTarget, "Should be an instance of AngleThresholdPair type.");
67 testingTarget.Dispose();
71 tlog.Debug(tag, $"AngleThresholdPairConstructorWithRadians END (OK)");
76 [Description("AngleThresholdPair constructor. With AngleThresholdPair.")]
77 [Property("SPEC", "Tizen.NUI.AngleThresholdPair.AngleThresholdPair C")]
78 [Property("SPEC_URL", "-")]
79 [Property("CRITERIA", "CONSTR")]
80 [Property("AUTHOR", "guowei.wang@samsung.com")]
81 public void AngleThresholdPairConstructorWithAngleThresholdPair()
83 tlog.Debug(tag, $"AngleThresholdPairConstructorWithAngleThresholdPair START");
85 using (Radian t = new Radian(0.3f))
87 using (Radian u = new Radian(0.8f))
89 using (AngleThresholdPair angleThresholdPair = new AngleThresholdPair(t, u))
91 var testingTarget = new AngleThresholdPair(angleThresholdPair);
92 Assert.IsNotNull(testingTarget, "Can't create success object AngleThresholdPair");
93 Assert.IsInstanceOf<AngleThresholdPair>(testingTarget, "Should be an instance of AngleThresholdPair type.");
95 testingTarget.Dispose();
100 tlog.Debug(tag, $"AngleThresholdPairConstructorWithAngleThresholdPair END (OK)");
105 [Description("AngleThresholdPair constructor. second.")]
106 [Property("SPEC", "Tizen.NUI.AngleThresholdPair.second A")]
107 [Property("SPEC_URL", "-")]
108 [Property("CRITERIA", "PRW")]
109 [Property("AUTHOR", "guowei.wang@samsung.com")]
110 public void AngleThresholdPairSecond()
112 tlog.Debug(tag, $"AngleThresholdPairSecond START");
114 using (Radian t = new Radian(0.3f))
116 using (Radian u = new Radian(0.8f))
118 var testingTarget = new AngleThresholdPair(t, u);
119 Assert.IsNotNull(testingTarget, "Can't create success object AngleThresholdPair");
120 Assert.IsInstanceOf<AngleThresholdPair>(testingTarget, "Should be an instance of AngleThresholdPair type.");
122 Assert.AreEqual(0.8f, testingTarget.second.ConvertToFloat(), "Should be equal!");
124 testingTarget.second = new Radian(0.9f);
125 Assert.AreEqual(0.9f, testingTarget.second.ConvertToFloat(), "Should be equal!");
127 testingTarget.Dispose();
131 tlog.Debug(tag, $"AngleThresholdPairSecond END (OK)");
136 [Description("AngleThresholdPair first.")]
137 [Property("SPEC", "Tizen.NUI.AngleThresholdPair.first A")]
138 [Property("SPEC_URL", "-")]
139 [Property("CRITERIA", "PRW")]
140 [Property("AUTHOR", "guowei.wang@samsung.com")]
141 public void AngleThresholdPairFirst()
143 tlog.Debug(tag, $"AngleThresholdPairFirst START");
145 using (Radian t = new Radian(0.3f))
147 using (Radian u = new Radian(0.8f))
149 var testingTarget = new AngleThresholdPair(t, u);
150 Assert.IsNotNull(testingTarget, "Can't create success object AngleThresholdPair");
151 Assert.IsInstanceOf<AngleThresholdPair>(testingTarget, "Should be an instance of AngleThresholdPair type.");
153 Assert.AreEqual(0.3f, testingTarget.first.ConvertToFloat(), "Should be equal!");
155 testingTarget.first = new Radian(0.4f);
156 Assert.AreEqual(0.4f, testingTarget.first.ConvertToFloat(), "Should be equal!");
158 testingTarget.Dispose();
162 tlog.Debug(tag, $"AngleThresholdPairFirst END (OK)");
167 [Description("AngleThresholdPair getCPtr.")]
168 [Property("SPEC", "Tizen.NUI.AngleThresholdPair.getCPtr M")]
169 [Property("SPEC_URL", "-")]
170 [Property("CRITERIA", "MR")]
171 [Property("AUTHOR", "guowei.wang@samsung.com")]
172 public void AngleThresholdPairGetCPtr()
174 tlog.Debug(tag, $"AngleThresholdPairGetCPtr START");
176 using (Radian t = new Radian(0.3f))
178 using (Radian u = new Radian(0.8f))
180 var testingTarget = new AngleThresholdPair(t, u);
181 Assert.IsNotNull(testingTarget, "Can't create success object AngleThresholdPair");
182 Assert.IsInstanceOf<AngleThresholdPair>(testingTarget, "Should be an instance of AngleThresholdPair type.");
186 AngleThresholdPair.getCPtr(testingTarget);
190 tlog.Debug(tag, e.Message.ToString());
191 Assert.Fail("Caught Exception : Failed!");
194 testingTarget.Dispose();
198 tlog.Debug(tag, $"AngleThresholdPairGetCPtr END (OK)");