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 getCPtr.")]
112 [Property("SPEC", "Tizen.NUI.Alignment.getCPtr M")]
113 [Property("SPEC_URL", "-")]
114 [Property("CRITERIA", "MR")]
115 [Property("AUTHOR", "guowei.wang@samsung.com")]
116 public void AlignmentGetCPtr()
118 tlog.Debug(tag, $"AlignmentGetCPtr START");
120 var testingTarget = new Alignment(new ImageView().SwigCPtr.Handle, false);
121 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
122 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
126 Alignment.getCPtr(testingTarget);
130 tlog.Debug(tag, e.Message.ToString());
131 Assert.Fail("Caught Exception : Failed!");
134 testingTarget.Dispose();
135 tlog.Debug(tag, $"AlignmentGetCPtr END (OK)");
140 [Description("Alignment.Padding constructor.")]
141 [Property("SPEC", "Tizen.NUI.Alignment.Padding.Padding C")]
142 [Property("SPEC_URL", "-")]
143 [Property("CRITERIA", "CONSTR")]
144 [Property("AUTHOR", "guowei.wang@samsung.com")]
145 public void AlignmentPadding()
147 tlog.Debug(tag, $"AlignmentPadding START");
149 var testingTarget = new Alignment.Padding();
150 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
151 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
153 testingTarget.Dispose();
154 tlog.Debug(tag, $"AlignmentPadding END (OK)");
159 [Description("Alignment.Padding constructor. With floats.")]
160 [Property("SPEC", "Tizen.NUI.Alignment.Padding.Padding C")]
161 [Property("SPEC_URL", "-")]
162 [Property("CRITERIA", "CONSTR")]
163 [Property("AUTHOR", "guowei.wang@samsung.com")]
164 public void AlignmentPaddingConstructorWithFloats()
166 tlog.Debug(tag, $"AlignmentPaddingConstructorWithFloats START");
168 var testingTarget = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f);
169 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
170 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
172 testingTarget.Dispose();
173 tlog.Debug(tag, $"AlignmentPaddingConstructorWithFloats END (OK)");
178 [Description("Alignment SetAlignmentType.")]
179 [Property("SPEC", "Tizen.NUI.Alignment.SetAlignmentType M")]
180 [Property("SPEC_URL", "-")]
181 [Property("CRITERIA", "MR")]
182 [Property("AUTHOR", "guowei.wang@samsung.com")]
183 public void AlignmentSetAlignmentType()
185 tlog.Debug(tag, $"AlignmentSetAlignmentType START");
187 var testingTarget = new Alignment(Alignment.Type.HorizontalCenter);
188 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
189 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
191 tlog.Debug(tag, "Alignment.Type : " + testingTarget.GetAlignmentType());
193 testingTarget.SetAlignmentType(Alignment.Type.VerticalBottom);
194 tlog.Debug(tag, "Alignment.Type : " + testingTarget.GetAlignmentType());
196 testingTarget.Dispose();
197 tlog.Debug(tag, $"AlignmentSetAlignmentType END (OK)");
202 [Description("Alignment SetScaling.")]
203 [Property("SPEC", "Tizen.NUI.Alignment.SetScaling M")]
204 [Property("SPEC_URL", "-")]
205 [Property("CRITERIA", "MR")]
206 [Property("AUTHOR", "guowei.wang@samsung.com")]
207 public void AlignmentSetScaling()
209 tlog.Debug(tag, $"AlignmentSetScaling START");
211 var testingTarget = new Alignment(Alignment.Type.HorizontalCenter);
212 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
213 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
215 tlog.Debug(tag, "Alignment.Scaling : " + testingTarget.GetScaling());
217 testingTarget.SetScaling(Alignment.Scaling.ScaleToFill);
218 tlog.Debug(tag, "Alignment.Scaling : " + testingTarget.GetScaling());
220 testingTarget.Dispose();
221 tlog.Debug(tag, $"AlignmentSetScaling END (OK)");
226 [Description("Alignment SetPadding.")]
227 [Property("SPEC", "Tizen.NUI.Alignment.SetPadding M")]
228 [Property("SPEC_URL", "-")]
229 [Property("CRITERIA", "MR")]
230 [Property("AUTHOR", "guowei.wang@samsung.com")]
231 public void AlignmentSetPadding()
233 tlog.Debug(tag, $"AlignmentSetPadding START");
235 var testingTarget = new Alignment(Alignment.Type.HorizontalCenter);
236 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
237 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
239 tlog.Debug(tag, "Alignment.Padding : " + testingTarget.GetPadding());
241 using (Alignment.Padding padding = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f))
243 testingTarget.SetPadding(padding);
244 tlog.Debug(tag, "Alignment.Padding : " + testingTarget.GetPadding());
247 testingTarget.Dispose();
248 tlog.Debug(tag, $"AlignmentSetPadding END (OK)");
253 [Description("Alignment.Padding getCPtr.")]
254 [Property("SPEC", "Tizen.NUI.Alignment.Padding getCPtr M")]
255 [Property("SPEC_URL", "-")]
256 [Property("CRITERIA", "MR")]
257 [Property("AUTHOR", "guowei.wang@samsung.com")]
258 public void AlignmentPaddingGetCPtr()
260 tlog.Debug(tag, $"AlignmentPaddingGetCPtr START");
262 var testingTarget = new Alignment.Padding();
263 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
264 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
268 Alignment.Padding.getCPtr(testingTarget);
272 tlog.Debug(tag, e.Message.ToString());
273 Assert.Fail("Caught Exception : Failed!");
276 testingTarget.Dispose();
277 tlog.Debug(tag, $"AlignmentPaddingGetCPtr END (OK)");
282 [Description("Alignment Assign.")]
283 [Property("SPEC", "Tizen.NUI.Alignment.Assign M")]
284 [Property("SPEC_URL", "-")]
285 [Property("CRITERIA", "MR")]
286 [Property("AUTHOR", "guowei.wang@samsung.com")]
287 public void AlignmentAssign()
289 tlog.Debug(tag, $"AlignmentAssign START");
291 var testingTarget = new Alignment();
292 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
293 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
297 testingTarget.Assign(testingTarget);
301 tlog.Debug(tag, e.Message.ToString());
302 Assert.Fail("Caught Exception : Failed!");
305 testingTarget.Dispose();
306 tlog.Debug(tag, $"AlignmentAssign END (OK)");
311 [Description("Alignment DownCast.")]
312 [Property("SPEC", "Tizen.NUI.Alignment.DownCast M")]
313 [Property("SPEC_URL", "-")]
314 [Property("CRITERIA", "MR")]
315 [Property("AUTHOR", "guowei.wang@samsung.com")]
316 public void AlignmentDownCast()
318 tlog.Debug(tag, $"AlignmentDownCast START");
320 var testingTarget = new Alignment();
321 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
322 Assert.IsInstanceOf<Alignment>(testingTarget, "Should be an instance of Alignment type.");
326 Alignment.DownCast(testingTarget);
330 tlog.Debug(tag, e.Message.ToString());
331 Assert.Fail("Caught Exception : Failed!");
334 testingTarget.Dispose();
335 tlog.Debug(tag, $"AlignmentDownCast END (OK)");
340 [Description("Alignment.Padding left.")]
341 [Property("SPEC", "Tizen.NUI.Alignment.Padding left A")]
342 [Property("SPEC_URL", "-")]
343 [Property("CRITERIA", "PRW")]
344 [Property("AUTHOR", "guowei.wang@samsung.com")]
345 public void AlignmentPaddingLeft()
347 tlog.Debug(tag, $"AlignmentPaddingLeft START");
349 var testingTarget = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f);
350 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
351 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
353 Assert.AreEqual(1.0f, testingTarget.left, "Should be equal!");
355 testingTarget.left = 4.0f;
356 Assert.AreEqual(4.0f, testingTarget.left, "Should be equal!");
358 testingTarget.Dispose();
359 tlog.Debug(tag, $"AlignmentPaddingLeft END (OK)");
364 [Description("Alignment.Padding right.")]
365 [Property("SPEC", "Tizen.NUI.Alignment.Padding right A")]
366 [Property("SPEC_URL", "-")]
367 [Property("CRITERIA", "PRW")]
368 [Property("AUTHOR", "guowei.wang@samsung.com")]
369 public void AlignmentPaddingRight()
371 tlog.Debug(tag, $"AlignmentPaddingRight START");
373 var testingTarget = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f);
374 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
375 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
377 Assert.AreEqual(2.0f, testingTarget.right, "Should be equal!");
379 testingTarget.right = 3.0f;
380 Assert.AreEqual(3.0f, testingTarget.right, "Should be equal!");
382 testingTarget.Dispose();
383 tlog.Debug(tag, $"AlignmentPaddingRight END (OK)");
388 [Description("Alignment.Padding top.")]
389 [Property("SPEC", "Tizen.NUI.Alignment.Padding top A")]
390 [Property("SPEC_URL", "-")]
391 [Property("CRITERIA", "PRW")]
392 [Property("AUTHOR", "guowei.wang@samsung.com")]
393 public void AlignmentPaddingTop()
395 tlog.Debug(tag, $"AlignmentPaddingTop START");
397 var testingTarget = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f);
398 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
399 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
401 Assert.AreEqual(3.0f, testingTarget.top, "Should be equal!");
403 testingTarget.top = 2.0f;
404 Assert.AreEqual(2.0f, testingTarget.top, "Should be equal!");
406 testingTarget.Dispose();
407 tlog.Debug(tag, $"AlignmentPaddingTop END (OK)");
412 [Description("Alignment.Padding bottom.")]
413 [Property("SPEC", "Tizen.NUI.Alignment.Padding bottom A")]
414 [Property("SPEC_URL", "-")]
415 [Property("CRITERIA", "PRW")]
416 [Property("AUTHOR", "guowei.wang@samsung.com")]
417 public void AlignmentPaddingBottom()
419 tlog.Debug(tag, $"AlignmentPaddingBottom START");
421 var testingTarget = new Alignment.Padding(1.0f, 2.0f, 3.0f, 4.0f);
422 Assert.IsNotNull(testingTarget, "Can't create success object Alignment");
423 Assert.IsInstanceOf<Alignment.Padding>(testingTarget, "Should be an instance of Padding type.");
425 Assert.AreEqual(4.0f, testingTarget.bottom, "Should be equal!");
427 testingTarget.bottom = 1.0f;
428 Assert.AreEqual(1.0f, testingTarget.bottom, "Should be equal!");
430 testingTarget.Dispose();
431 tlog.Debug(tag, $"AlignmentPaddingBottom END (OK)");