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/Alignment")]
13 public class InternalAlignmentTest
15 private const string tag = "NUITEST";
20 tlog.Info(tag, "Init() is called!");
26 tlog.Info(tag, "Destroy() is called!");
31 [Description("Alignment constructor.")]
32 [Property("SPEC", "Tizen.NUI.Alignment.Alignment C")]
33 [Property("SPEC_URL", "-")]
34 [Property("CRITERIA", "CONSTR")]
35 [Property("AUTHOR", "guowei.wang@samsung.com")]
36 public void AlignmentConstructor()
38 tlog.Debug(tag, $"AlignmentConstructor START");
40 var testingTarget = new Alignment();
41 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
42 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
44 testingTarget.Dispose();
45 tlog.Debug(tag, $"AlignmentConstructor END (OK)");
50 [Description("Alignment constructor. With horizontal type.")]
51 [Property("SPEC", "Tizen.NUI.Alignment.Alignment C")]
52 [Property("SPEC_URL", "-")]
53 [Property("CRITERIA", "CONSTR")]
54 [Property("AUTHOR", "guowei.wang@samsung.com")]
55 public void AlignmentConstructorWithHorizontalType()
57 tlog.Debug(tag, $"AlignmentConstructorWithHorizontalType START");
59 var testingTarget = new Alignment(Alignment.Type.HorizontalCenter);
60 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
61 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
63 testingTarget.Dispose();
64 tlog.Debug(tag, $"AlignmentConstructorWithHorizontalType END (OK)");
69 [Description("Alignment constructor. With horizontal & vertical type.")]
70 [Property("SPEC", "Tizen.NUI.Alignment.Alignment C")]
71 [Property("SPEC_URL", "-")]
72 [Property("CRITERIA", "CONSTR")]
73 [Property("AUTHOR", "guowei.wang@samsung.com")]
74 public void AlignmentConstructorWithHorizontalAndVerticalType()
76 tlog.Debug(tag, $"AlignmentConstructorWithHorizontalAndVerticalType START");
78 var testingTarget = new Alignment(Alignment.Type.HorizontalCenter, Alignment.Type.VerticalCenter);
79 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
80 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
82 testingTarget.Dispose();
83 tlog.Debug(tag, $"AlignmentConstructorWithHorizontalAndVerticalType END (OK)");
88 [Description("Alignment constructor. With Alignment.")]
89 [Property("SPEC", "Tizen.NUI.Alignment.Alignment C")]
90 [Property("SPEC_URL", "-")]
91 [Property("CRITERIA", "CONSTR")]
92 [Property("AUTHOR", "guowei.wang@samsung.com")]
93 public void AlignmentConstructorWithAlignment()
95 tlog.Debug(tag, $"AlignmentConstructorWithAlignment START");
97 using (Alignment alignMent = new Alignment(Alignment.Type.HorizontalRight))
99 var testingTarget = new Alignment(alignMent);
100 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
101 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
103 testingTarget.Dispose();
106 tlog.Debug(tag, $"AlignmentConstructorWithAlignment END (OK)");
111 [Description("Alignment.Padding constructor.")]
112 [Property("SPEC", "Tizen.NUI.Alignment.Padding.Padding C")]
113 [Property("SPEC_URL", "-")]
114 [Property("CRITERIA", "CONSTR")]
115 [Property("AUTHOR", "guowei.wang@samsung.com")]
116 public void AlignmentPadding()
118 tlog.Debug(tag, $"AlignmentPadding START");
120 var testingTarget = new Alignment.Padding();
121 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
122 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
124 testingTarget.Dispose();
125 tlog.Debug(tag, $"AlignmentPadding END (OK)");
130 [Description("Alignment.Padding constructor. With floats.")]
131 [Property("SPEC", "Tizen.NUI.Alignment.Padding.Padding C")]
132 [Property("SPEC_URL", "-")]
133 [Property("CRITERIA", "CONSTR")]
134 [Property("AUTHOR", "guowei.wang@samsung.com")]
135 public void AlignmentPaddingConstructorWithFloats()
137 tlog.Debug(tag, $"AlignmentPaddingConstructorWithFloats START");
139 var testingTarget = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f);
140 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
141 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
143 testingTarget.Dispose();
144 tlog.Debug(tag, $"AlignmentPaddingConstructorWithFloats END (OK)");
149 [Description("Alignment SetAlignmentType.")]
150 [Property("SPEC", "Tizen.NUI.Alignment.SetAlignmentType M")]
151 [Property("SPEC_URL", "-")]
152 [Property("CRITERIA", "MR")]
153 [Property("AUTHOR", "guowei.wang@samsung.com")]
154 public void AlignmentSetAlignmentType()
156 tlog.Debug(tag, $"AlignmentSetAlignmentType START");
158 var testingTarget = new Alignment(Alignment.Type.HorizontalCenter);
159 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
160 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
162 tlog.Debug(tag, "Alignment.Type : " + testingTarget.GetAlignmentType());
164 testingTarget.SetAlignmentType(Alignment.Type.VerticalBottom);
165 tlog.Debug(tag, "Alignment.Type : " + testingTarget.GetAlignmentType());
167 testingTarget.Dispose();
168 tlog.Debug(tag, $"AlignmentSetAlignmentType END (OK)");
173 [Description("Alignment SetScaling.")]
174 [Property("SPEC", "Tizen.NUI.Alignment.SetScaling M")]
175 [Property("SPEC_URL", "-")]
176 [Property("CRITERIA", "MR")]
177 [Property("AUTHOR", "guowei.wang@samsung.com")]
178 public void AlignmentSetScaling()
180 tlog.Debug(tag, $"AlignmentSetScaling START");
182 var testingTarget = new Alignment(Alignment.Type.HorizontalCenter);
183 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
184 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
186 tlog.Debug(tag, "Alignment.Scaling : " + testingTarget.GetScaling());
188 testingTarget.SetScaling(Alignment.Scaling.ScaleToFill);
189 tlog.Debug(tag, "Alignment.Scaling : " + testingTarget.GetScaling());
191 testingTarget.Dispose();
192 tlog.Debug(tag, $"AlignmentSetScaling END (OK)");
197 [Description("Alignment SetPadding.")]
198 [Property("SPEC", "Tizen.NUI.Alignment.SetPadding M")]
199 [Property("SPEC_URL", "-")]
200 [Property("CRITERIA", "MR")]
201 [Property("AUTHOR", "guowei.wang@samsung.com")]
202 public void AlignmentSetPadding()
204 tlog.Debug(tag, $"AlignmentSetPadding START");
206 var testingTarget = new Alignment(Alignment.Type.HorizontalCenter);
207 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
208 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
210 tlog.Debug(tag, "Alignment.Padding : " + testingTarget.GetPadding());
212 using (Alignment.Padding padding = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f))
214 testingTarget.SetPadding(padding);
215 tlog.Debug(tag, "Alignment.Padding : " + testingTarget.GetPadding());
218 testingTarget.Dispose();
219 tlog.Debug(tag, $"AlignmentSetPadding END (OK)");
224 [Description("Alignment Assign.")]
225 [Property("SPEC", "Tizen.NUI.Alignment.Assign M")]
226 [Property("SPEC_URL", "-")]
227 [Property("CRITERIA", "MR")]
228 [Property("AUTHOR", "guowei.wang@samsung.com")]
229 public void AlignmentAssign()
231 tlog.Debug(tag, $"AlignmentAssign START");
233 var testingTarget = new Alignment();
234 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
235 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
239 testingTarget.Assign(testingTarget);
243 tlog.Debug(tag, e.Message.ToString());
244 Assert.Fail("Caught Exception : Failed!");
247 testingTarget.Dispose();
248 tlog.Debug(tag, $"AlignmentAssign END (OK)");
253 [Description("Alignment DownCast.")]
254 [Property("SPEC", "Tizen.NUI.Alignment.DownCast M")]
255 [Property("SPEC_URL", "-")]
256 [Property("CRITERIA", "MR")]
257 [Property("AUTHOR", "guowei.wang@samsung.com")]
258 public void AlignmentDownCast()
260 tlog.Debug(tag, $"AlignmentDownCast START");
262 var testingTarget = new Alignment();
263 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
264 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
268 Alignment.DownCast(testingTarget);
272 tlog.Debug(tag, e.Message.ToString());
273 Assert.Fail("Caught Exception : Failed!");
276 testingTarget.Dispose();
277 tlog.Debug(tag, $"AlignmentDownCast END (OK)");
282 [Description("Alignment.Padding left.")]
283 [Property("SPEC", "Tizen.NUI.Alignment.Padding left A")]
284 [Property("SPEC_URL", "-")]
285 [Property("CRITERIA", "PRW")]
286 [Property("AUTHOR", "guowei.wang@samsung.com")]
287 public void AlignmentPaddingLeft()
289 tlog.Debug(tag, $"AlignmentPaddingLeft START");
291 var testingTarget = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f);
292 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
293 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
295 Assert.AreEqual(1.0f, testingTarget.left, "Should be equal!");
297 testingTarget.left = 4.0f;
298 Assert.AreEqual(4.0f, testingTarget.left, "Should be equal!");
300 testingTarget.Dispose();
301 tlog.Debug(tag, $"AlignmentPaddingLeft END (OK)");
306 [Description("Alignment.Padding right.")]
307 [Property("SPEC", "Tizen.NUI.Alignment.Padding right A")]
308 [Property("SPEC_URL", "-")]
309 [Property("CRITERIA", "PRW")]
310 [Property("AUTHOR", "guowei.wang@samsung.com")]
311 public void AlignmentPaddingRight()
313 tlog.Debug(tag, $"AlignmentPaddingRight START");
315 var testingTarget = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f);
316 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
317 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
319 Assert.AreEqual(2.0f, testingTarget.right, "Should be equal!");
321 testingTarget.right = 3.0f;
322 Assert.AreEqual(3.0f, testingTarget.right, "Should be equal!");
324 testingTarget.Dispose();
325 tlog.Debug(tag, $"AlignmentPaddingRight END (OK)");
330 [Description("Alignment.Padding top.")]
331 [Property("SPEC", "Tizen.NUI.Alignment.Padding top A")]
332 [Property("SPEC_URL", "-")]
333 [Property("CRITERIA", "PRW")]
334 [Property("AUTHOR", "guowei.wang@samsung.com")]
335 public void AlignmentPaddingTop()
337 tlog.Debug(tag, $"AlignmentPaddingTop START");
339 var testingTarget = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f);
340 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
341 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
343 Assert.AreEqual(3.0f, testingTarget.top, "Should be equal!");
345 testingTarget.top = 2.0f;
346 Assert.AreEqual(2.0f, testingTarget.top, "Should be equal!");
348 testingTarget.Dispose();
349 tlog.Debug(tag, $"AlignmentPaddingTop END (OK)");
354 [Description("Alignment.Padding bottom.")]
355 [Property("SPEC", "Tizen.NUI.Alignment.Padding bottom A")]
356 [Property("SPEC_URL", "-")]
357 [Property("CRITERIA", "PRW")]
358 [Property("AUTHOR", "guowei.wang@samsung.com")]
359 public void AlignmentPaddingBottom()
361 tlog.Debug(tag, $"AlignmentPaddingBottom START");
363 var testingTarget = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f);
364 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
365 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
367 Assert.AreEqual(4.0f, testingTarget.bottom, "Should be equal!");
369 testingTarget.bottom = 1.0f;
370 Assert.AreEqual(1.0f, testingTarget.bottom, "Should be equal!");
372 testingTarget.Dispose();
373 tlog.Debug(tag, $"AlignmentPaddingBottom END (OK)");