3 using NUnit.Framework.TUnit;
4 using Tizen.NUI.Components;
5 using Tizen.NUI.BaseComponents;
6 using System.Collections.Generic;
8 namespace Tizen.NUI.Devel.Tests
10 using tlog = Tizen.Log;
13 [Description("public/Layouting/FlexLayout")]
14 public class PublicFlexLayoutTest
16 private const string tag = "NUITEST";
21 tlog.Info(tag, "Init() is called!");
27 tlog.Info(tag, "Destroy() is called!");
30 private static bool flagOnMeasureOverride;
31 private static bool flagOnLayoutOverride;
32 private static bool flagOnChildAddOverride;
33 private static bool flagOnChildRemoveOverride;
34 internal class MyFlexLayout : FlexLayout
36 public MyFlexLayout() : base()
39 public void OnMeasureTest(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
41 OnMeasure(widthMeasureSpec, heightMeasureSpec);
43 protected override void OnMeasure(MeasureSpecification widthMeasureSpec, MeasureSpecification heightMeasureSpec)
45 flagOnMeasureOverride = true;
46 base.OnMeasure(widthMeasureSpec, heightMeasureSpec);
49 public void OnLayoutTest(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
51 OnLayout(changed, left, top, right, bottom);
53 protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom)
55 flagOnLayoutOverride = true;
56 base.OnLayout(changed, left, top, right, bottom);
59 public void OnChildAddTest(LayoutItem child)
63 protected override void OnChildAdd(LayoutItem child)
65 flagOnChildAddOverride = true;
66 base.OnChildAdd(child);
69 public void OnChildRemoveTest(LayoutItem child)
73 protected override void OnChildRemove(LayoutItem child)
75 flagOnChildRemoveOverride = true;
76 base.OnChildRemove(child);
82 [Description("FlexLayout constructor")]
83 [Property("SPEC", "Tizen.NUI.FlexLayout.FlexLayout C")]
84 [Property("SPEC_URL", "-")]
85 [Property("CRITERIA", "CONSTR")]
86 [Property("AUTHOR", "guowei.wang@samsung.com")]
87 public void FlexLayoutConstructor()
89 tlog.Debug(tag, $"FlexLayoutConstructor START");
91 var testingTarget = new FlexLayout();
92 Assert.IsNotNull(testingTarget, "null handle");
93 Assert.IsInstanceOf<FlexLayout>(testingTarget, "Should return FlexLayout instance.");
95 testingTarget.Dispose();
96 tlog.Debug(tag, $"FlexLayoutConstructor END (OK)");
101 [Description("FlexLayout SetFlexAlignmentSelf")]
102 [Property("SPEC", "Tizen.NUI.FlexLayout.SetFlexAlignmentSelf M")]
103 [Property("SPEC_URL", "-")]
104 [Property("CRITERIA", "MR")]
105 [Property("AUTHOR", "guowei.wang@samsung.com")]
106 public void FlexLayoutSetFlexAlignmentSelf()
108 tlog.Debug(tag, $"FlexLayoutSetFlexAlignmentSelf START");
110 View view = new View()
112 Size = new Size(400, 400),
113 BackgroundColor = Color.White,
114 Layout = new FlexLayout()
116 Direction = FlexLayout.FlexDirection.Column,
122 FlexLayout.SetFlexAlignmentSelf(view, FlexLayout.AlignmentType.FlexStart);
126 tlog.Error(tag, "Caught Exception" + e.ToString());
127 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
128 Assert.Fail("Caught Exception" + e.ToString());
132 tlog.Debug(tag, $"FlexLayoutSetFlexAlignmentSelf END (OK)");
137 [Description("FlexLayout GetFlexAlignmentSelf")]
138 [Property("SPEC", "Tizen.NUI.FlexLayout.GetFlexAlignmentSelf M")]
139 [Property("SPEC_URL", "-")]
140 [Property("CRITERIA", "MR")]
141 [Property("AUTHOR", "guowei.wang@samsung.com")]
142 public void FlexLayoutGetFlexAlignmentSelf()
144 tlog.Debug(tag, $"FlexLayoutGetFlexAlignmentSelf START");
146 View view = new View()
148 Size = new Size(400, 400),
149 BackgroundColor = Color.White,
150 Layout = new FlexLayout()
152 Direction = FlexLayout.FlexDirection.Column,
156 FlexLayout.SetFlexAlignmentSelf(view, FlexLayout.AlignmentType.FlexStart);
157 var result = FlexLayout.GetFlexAlignmentSelf(view);
158 Assert.AreEqual(FlexLayout.AlignmentType.FlexStart, result, "should be equal!");
161 tlog.Debug(tag, $"FlexLayoutGetFlexAlignmentSelf END (OK)");
166 [Description("FlexLayout SetFlexPositionType")]
167 [Property("SPEC", "Tizen.NUI.FlexLayout.SetFlexPositionType M")]
168 [Property("SPEC_URL", "-")]
169 [Property("CRITERIA", "MR")]
170 [Property("AUTHOR", "guowei.wang@samsung.com")]
171 public void FlexLayoutSetFlexPositionType()
173 tlog.Debug(tag, $"FlexLayoutSetFlexPositionType START");
175 View view = new View()
177 Size = new Size(400, 400),
178 BackgroundColor = Color.White,
179 Layout = new FlexLayout()
181 Direction = FlexLayout.FlexDirection.Column,
187 FlexLayout.SetFlexPositionType(view, FlexLayout.PositionType.Relative);
191 tlog.Error(tag, "Caught Exception" + e.ToString());
192 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
193 Assert.Fail("Caught Exception" + e.ToString());
197 tlog.Debug(tag, $"FlexLayoutSetFlexPositionType END (OK)");
202 [Description("FlexLayout GetFlexPositionType")]
203 [Property("SPEC", "Tizen.NUI.FlexLayout.GetFlexPositionType M")]
204 [Property("SPEC_URL", "-")]
205 [Property("CRITERIA", "MR")]
206 [Property("AUTHOR", "guowei.wang@samsung.com")]
207 public void FlexLayoutGetFlexPositionType()
209 tlog.Debug(tag, $"FlexLayoutGetFlexPositionType START");
211 View view = new View()
213 Size = new Size(400, 400),
214 BackgroundColor = Color.White,
215 Layout = new FlexLayout()
217 Direction = FlexLayout.FlexDirection.Column,
221 FlexLayout.SetFlexPositionType(view, FlexLayout.PositionType.Relative);
222 var result = FlexLayout.GetFlexPositionType(view);
223 Assert.AreEqual(FlexLayout.PositionType.Relative, result, "should be equal!");
226 tlog.Debug(tag, $"FlexLayoutGetFlexPositionType END (OK)");
231 [Description("FlexLayout SetFlexAspectRatio")]
232 [Property("SPEC", "Tizen.NUI.FlexLayout.SetFlexAspectRatio M")]
233 [Property("SPEC_URL", "-")]
234 [Property("CRITERIA", "MR")]
235 [Property("AUTHOR", "guowei.wang@samsung.com")]
236 public void FlexLayoutSetFlexAspectRatio()
238 tlog.Debug(tag, $"FlexLayoutSetFlexAspectRatio START");
240 View view = new View()
242 Size = new Size(400, 400),
243 BackgroundColor = Color.White,
244 Layout = new FlexLayout()
246 Direction = FlexLayout.FlexDirection.Column,
252 FlexLayout.SetFlexAspectRatio(view, 0.3f);
256 tlog.Error(tag, "Caught Exception" + e.ToString());
257 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
258 Assert.Fail("Caught Exception" + e.ToString());
262 tlog.Debug(tag, $"FlexLayoutSetFlexAspectRatio END (OK)");
267 [Description("FlexLayout GetFlexAspectRatio")]
268 [Property("SPEC", "Tizen.NUI.FlexLayout.GetFlexAspectRatio M")]
269 [Property("SPEC_URL", "-")]
270 [Property("CRITERIA", "MR")]
271 [Property("AUTHOR", "guowei.wang@samsung.com")]
272 public void FlexLayoutGetFlexAspectRatio()
274 tlog.Debug(tag, $"FlexLayoutGetFlexAspectRatio START");
276 View view = new View()
278 Size = new Size(400, 400),
279 BackgroundColor = Color.White,
280 Layout = new FlexLayout()
282 Direction = FlexLayout.FlexDirection.Column,
286 FlexLayout.SetFlexAspectRatio(view, 0.3f);
287 var result = FlexLayout.GetFlexAspectRatio(view);
288 Assert.AreEqual(0.3f, result, "should be equal!");
291 tlog.Debug(tag, $"FlexLayoutGetFlexAspectRatio END (OK)");
296 [Description("FlexLayout SetFlexBasis")]
297 [Property("SPEC", "Tizen.NUI.FlexLayout.SetFlexBasis M")]
298 [Property("SPEC_URL", "-")]
299 [Property("CRITERIA", "MR")]
300 [Property("AUTHOR", "guowei.wang@samsung.com")]
301 public void FlexLayoutSetFlexBasis()
303 tlog.Debug(tag, $"FlexLayoutSetFlexBasis START");
305 View view = new View()
307 Size = new Size(400, 400),
308 BackgroundColor = Color.White,
309 Layout = new FlexLayout()
311 Direction = FlexLayout.FlexDirection.Column,
317 FlexLayout.SetFlexBasis(view, 0.6f);
321 tlog.Error(tag, "Caught Exception" + e.ToString());
322 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
323 Assert.Fail("Caught Exception" + e.ToString());
327 tlog.Debug(tag, $"FlexLayoutSetFlexBasis END (OK)");
332 [Description("FlexLayout GetFlexBasis")]
333 [Property("SPEC", "Tizen.NUI.FlexLayout.GetFlexBasis M")]
334 [Property("SPEC_URL", "-")]
335 [Property("CRITERIA", "MR")]
336 [Property("AUTHOR", "guowei.wang@samsung.com")]
337 public void FlexLayoutGetFlexBasis()
339 tlog.Debug(tag, $"FlexLayoutGetFlexBasis START");
341 View view = new View()
343 Size = new Size(400, 400),
344 BackgroundColor = Color.White,
345 Layout = new FlexLayout()
347 Direction = FlexLayout.FlexDirection.Column,
351 FlexLayout.SetFlexBasis(view, 0.6f);
352 var result = FlexLayout.GetFlexBasis(view);
353 Assert.AreEqual(0.6f, result, "should be equal!");
356 tlog.Debug(tag, $"FlexLayoutGetFlexBasis END (OK)");
361 [Description("FlexLayout SetFlexShrink")]
362 [Property("SPEC", "Tizen.NUI.FlexLayout.SetFlexShrink M")]
363 [Property("SPEC_URL", "-")]
364 [Property("CRITERIA", "MR")]
365 [Property("AUTHOR", "guowei.wang@samsung.com")]
366 public void FlexLayoutSetFlexShrink()
368 tlog.Debug(tag, $"FlexLayoutSetFlexShrink START");
370 View view = new View()
372 Size = new Size(400, 400),
373 BackgroundColor = Color.White,
374 Layout = new FlexLayout()
376 Direction = FlexLayout.FlexDirection.Column,
382 FlexLayout.SetFlexShrink(view, 0.9f);
386 tlog.Error(tag, "Caught Exception" + e.ToString());
387 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
388 Assert.Fail("Caught Exception" + e.ToString());
392 tlog.Debug(tag, $"FlexLayoutSetFlexShrink END (OK)");
397 [Description("FlexLayout GetFlexShrink")]
398 [Property("SPEC", "Tizen.NUI.FlexLayout.GetFlexShrink M")]
399 [Property("SPEC_URL", "-")]
400 [Property("CRITERIA", "MR")]
401 [Property("AUTHOR", "guowei.wang@samsung.com")]
402 public void FlexLayoutGetFlexShrink()
404 tlog.Debug(tag, $"FlexLayoutGetFlexShrink START");
406 View view = new View()
408 Size = new Size(400, 400),
409 BackgroundColor = Color.White,
410 Layout = new FlexLayout()
412 Direction = FlexLayout.FlexDirection.Column,
416 FlexLayout.SetFlexShrink(view, 0.9f);
417 var result = FlexLayout.GetFlexShrink(view);
418 Assert.AreEqual(0.9f, result, "should be equal!");
421 tlog.Debug(tag, $"FlexLayoutGetFlexShrink END (OK)");
426 [Description("FlexLayout SetFlexGrow")]
427 [Property("SPEC", "Tizen.NUI.FlexLayout.SetFlexGrow M")]
428 [Property("SPEC_URL", "-")]
429 [Property("CRITERIA", "MR")]
430 [Property("AUTHOR", "guowei.wang@samsung.com")]
431 public void FlexLayoutSetFlexGrow()
433 tlog.Debug(tag, $"FlexLayoutSetFlexGrow START");
435 View view = new View()
437 Size = new Size(400, 400),
438 BackgroundColor = Color.White,
439 Layout = new FlexLayout()
441 Direction = FlexLayout.FlexDirection.Column,
447 FlexLayout.SetFlexGrow(view, 0.2f);
451 tlog.Error(tag, "Caught Exception" + e.ToString());
452 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
453 Assert.Fail("Caught Exception" + e.ToString());
457 tlog.Debug(tag, $"FlexLayoutSetFlexGrow END (OK)");
462 [Description("FlexLayout GetFlexGrow")]
463 [Property("SPEC", "Tizen.NUI.FlexLayout.GetFlexGrow M")]
464 [Property("SPEC_URL", "-")]
465 [Property("CRITERIA", "MR")]
466 [Property("AUTHOR", "guowei.wang@samsung.com")]
467 public void FlexLayoutGetFlexGrow()
469 tlog.Debug(tag, $"FlexLayoutGetFlexGrow START");
471 View view = new View()
473 Size = new Size(400, 400),
474 BackgroundColor = Color.White,
475 Layout = new FlexLayout()
477 Direction = FlexLayout.FlexDirection.Column,
481 FlexLayout.SetFlexGrow(view, 0.2f);
482 var result = FlexLayout.GetFlexGrow(view);
483 Assert.AreEqual(0.2f, result, "should be equal!");
486 tlog.Debug(tag, $"FlexLayoutGetFlexGrow END (OK)");
491 [Description("FlexLayout DownCast")]
492 [Property("SPEC", "Tizen.NUI.FlexLayout.DownCast M")]
493 [Property("SPEC_URL", "-")]
494 [Property("CRITERIA", "MR")]
495 [Property("AUTHOR", "guowei.wang@samsung.com")]
496 public void FlexLayoutDownCast()
498 tlog.Debug(tag, $"FlexLayoutDownCast START");
500 View view = new View()
502 Size = new Size(400, 400),
503 BackgroundColor = Color.White,
504 Layout = new FlexLayout()
506 Direction = FlexLayout.FlexDirection.Column,
510 var testingTarget = FlexLayout.DownCast(view);
511 Assert.IsNotNull(testingTarget, "null handle");
512 Assert.IsInstanceOf<FlexLayout>(testingTarget, "Should return FlexLayout instance.");
515 testingTarget.Dispose();
516 tlog.Debug(tag, $"FlexLayoutDownCast END (OK)");
521 [Description("FlexLayout Direction")]
522 [Property("SPEC", "Tizen.NUI.FlexLayout.Direction A")]
523 [Property("SPEC_URL", "-")]
524 [Property("CRITERIA", "PRW")]
525 [Property("AUTHOR", "guowei.wang@samsung.com")]
526 public void FlexLayoutDirection()
528 tlog.Debug(tag, $"FlexLayoutDirection START");
530 var testingTarget = new FlexLayout();
531 Assert.IsNotNull(testingTarget, "null handle");
532 Assert.IsInstanceOf<FlexLayout>(testingTarget, "Should return FlexLayout instance.");
534 testingTarget.Direction = FlexLayout.FlexDirection.Column;
535 Assert.AreEqual(testingTarget.Direction, FlexLayout.FlexDirection.Column, "Should be Column.");
537 testingTarget.Direction = FlexLayout.FlexDirection.Row;
538 Assert.AreEqual(testingTarget.Direction, FlexLayout.FlexDirection.Row, "Should be Row.");
540 testingTarget.Direction = FlexLayout.FlexDirection.ColumnReverse;
541 Assert.AreEqual(testingTarget.Direction, FlexLayout.FlexDirection.ColumnReverse, "Should be ColumnReverse.");
543 testingTarget.Direction = FlexLayout.FlexDirection.RowReverse;
544 Assert.AreEqual(testingTarget.Direction, FlexLayout.FlexDirection.RowReverse, "Should be RowReverse.");
546 testingTarget.Dispose();
547 tlog.Debug(tag, $"FlexLayoutDirection END (OK)");
552 [Description("FlexLayout Justification")]
553 [Property("SPEC", "Tizen.NUI.FlexLayout.Justification A")]
554 [Property("SPEC_URL", "-")]
555 [Property("CRITERIA", "PRW")]
556 [Property("AUTHOR", "guowei.wang@samsung.com")]
557 public void FlexLayoutJustification()
559 tlog.Debug(tag, $"FlexLayoutJustification START");
561 var testingTarget = new FlexLayout();
562 Assert.IsNotNull(testingTarget, "null handle");
563 Assert.IsInstanceOf<FlexLayout>(testingTarget, "Should return FlexLayout instance.");
565 testingTarget.Justification = FlexLayout.FlexJustification.FlexStart;
566 Assert.AreEqual(testingTarget.Justification, FlexLayout.FlexJustification.FlexStart, "Should be FlexStart.");
568 testingTarget.Justification = FlexLayout.FlexJustification.FlexEnd;
569 Assert.AreEqual(testingTarget.Justification, FlexLayout.FlexJustification.FlexEnd, "Should be FlexEnd.");
571 testingTarget.Justification = FlexLayout.FlexJustification.Center;
572 Assert.AreEqual(testingTarget.Justification, FlexLayout.FlexJustification.Center, "Should be Center.");
574 testingTarget.Justification = FlexLayout.FlexJustification.SpaceBetween;
575 Assert.AreEqual(testingTarget.Justification, FlexLayout.FlexJustification.SpaceBetween, "Should be SpaceBetween.");
577 testingTarget.Justification = FlexLayout.FlexJustification.SpaceAround;
578 Assert.AreEqual(testingTarget.Justification, FlexLayout.FlexJustification.SpaceAround, "Should be SpaceAround.");
580 testingTarget.Dispose();
581 tlog.Debug(tag, $"FlexLayoutJustification END (OK)");
586 [Description("FlexLayout WrapType")]
587 [Property("SPEC", "Tizen.NUI.FlexLayout.WrapType A")]
588 [Property("SPEC_URL", "-")]
589 [Property("CRITERIA", "PRW")]
590 [Property("AUTHOR", "guowei.wang@samsung.com")]
591 public void FlexLayoutWrapType()
593 tlog.Debug(tag, $"FlexLayoutWrapType START");
595 var testingTarget = new FlexLayout();
596 Assert.IsNotNull(testingTarget, "null handle");
597 Assert.IsInstanceOf<FlexLayout>(testingTarget, "Should return FlexLayout instance.");
599 testingTarget.WrapType = FlexLayout.FlexWrapType.NoWrap;
600 Assert.AreEqual(testingTarget.WrapType, FlexLayout.FlexWrapType.NoWrap, "Should be NoWrap.");
602 testingTarget.WrapType = FlexLayout.FlexWrapType.Wrap;
603 Assert.AreEqual(testingTarget.WrapType, FlexLayout.FlexWrapType.Wrap, "Should be Wrap.");
605 testingTarget.Dispose();
606 tlog.Debug(tag, $"FlexLayoutWrapType END (OK)");
611 [Description("FlexLayout Alignment")]
612 [Property("SPEC", "Tizen.NUI.FlexLayout.Alignment A")]
613 [Property("SPEC_URL", "-")]
614 [Property("CRITERIA", "PRW")]
615 [Property("AUTHOR", "guowei.wang@samsung.com")]
616 public void FlexLayoutAlignment()
618 tlog.Debug(tag, $"FlexLayoutAlignment START");
620 var testingTarget = new FlexLayout();
621 Assert.IsNotNull(testingTarget, "null handle");
622 Assert.IsInstanceOf<FlexLayout>(testingTarget, "Should return FlexLayout instance.");
624 testingTarget.Alignment = FlexLayout.AlignmentType.FlexStart;
625 Assert.AreEqual(testingTarget.Alignment, FlexLayout.AlignmentType.FlexStart, "Should be FlexStart.");
627 testingTarget.Alignment = FlexLayout.AlignmentType.FlexEnd;
628 Assert.AreEqual(testingTarget.Alignment, FlexLayout.AlignmentType.FlexEnd, "Should be FlexEnd.");
630 testingTarget.Alignment = FlexLayout.AlignmentType.Auto;
631 Assert.AreEqual(testingTarget.Alignment, FlexLayout.AlignmentType.Auto, "Should be Auto.");
633 testingTarget.Alignment = FlexLayout.AlignmentType.Center;
634 Assert.AreEqual(testingTarget.Alignment, FlexLayout.AlignmentType.Center, "Should be Center.");
636 testingTarget.Alignment = FlexLayout.AlignmentType.Stretch;
637 Assert.AreEqual(testingTarget.Alignment, FlexLayout.AlignmentType.Stretch, "Should be Stretch.");
639 testingTarget.Dispose();
640 tlog.Debug(tag, $"FlexLayoutAlignment END (OK)");
645 [Description("FlexLayout ItemsAlignment")]
646 [Property("SPEC", "Tizen.NUI.FlexLayout.ItemsAlignment A")]
647 [Property("SPEC_URL", "-")]
648 [Property("CRITERIA", "PRW")]
649 [Property("AUTHOR", "guowei.wang@samsung.com")]
650 public void FlexLayoutItemsAlignment()
652 tlog.Debug(tag, $"FlexLayoutItemsAlignment START");
654 var testingTarget = new FlexLayout();
655 Assert.IsNotNull(testingTarget, "null handle");
656 Assert.IsInstanceOf<FlexLayout>(testingTarget, "Should return FlexLayout instance.");
658 testingTarget.ItemsAlignment = FlexLayout.AlignmentType.FlexStart;
659 Assert.AreEqual(testingTarget.ItemsAlignment, FlexLayout.AlignmentType.FlexStart, "Should be FlexStart.");
661 testingTarget.ItemsAlignment = FlexLayout.AlignmentType.FlexEnd;
662 Assert.AreEqual(testingTarget.ItemsAlignment, FlexLayout.AlignmentType.FlexEnd, "Should be FlexEnd.");
664 testingTarget.Dispose();
665 tlog.Debug(tag, $"FlexLayoutItemsAlignment END (OK)");
670 [Description("FlexLayout OnMeasure")]
671 [Property("SPEC", "Tizen.NUI.FlexLayout.OnMeasure M")]
672 [Property("SPEC_URL", "-")]
673 [Property("CRITERIA", "MCST")]
674 [Property("AUTHOR", "guowei.wang@samsung.com")]
675 public void FlexLayoutOnMeasure()
677 tlog.Debug(tag, $"FlexLayoutOnMeasure START");
679 flagOnMeasureOverride = false;
680 Assert.False(flagOnMeasureOverride, "flagOnMeasureOverride should be false initial");
682 LayoutItem layoutItem = new LinearLayout();
684 View view = new View()
686 ExcludeLayouting = false,
687 Size = new Size(100, 150),
688 Layout = new FlexLayout()
691 layoutItem.AttachToOwner(view);
693 var testingTarget = new MyFlexLayout();
694 Assert.IsNotNull(testingTarget, "null handle");
695 Assert.IsInstanceOf<FlexLayout>(testingTarget, "Should be an instance of FlexLayout type.");
697 testingTarget.AttachToOwner(view);
698 testingTarget.Add(layoutItem);
700 MeasureSpecification measureWidth = new MeasureSpecification(new LayoutLength(50.0f), MeasureSpecification.ModeType.Exactly);
701 MeasureSpecification measureHeight = new MeasureSpecification(new LayoutLength(50.0f), MeasureSpecification.ModeType.AtMost);
703 testingTarget.OnMeasureTest(measureWidth, measureHeight);
704 Assert.True(flagOnMeasureOverride, "FlexLayout overridden method not invoked.");
706 tlog.Debug(tag, $"FlexLayoutOnMeasure END (OK)");
711 [Description("FlexLayout OnLayout")]
712 [Property("SPEC", "Tizen.NUI.FlexLayout.OnLayout M")]
713 [Property("SPEC_URL", "-")]
714 [Property("CRITERIA", "MCST")]
715 [Property("AUTHOR", "guowei.wang@samsung.com")]
716 public void FlexLayoutOnLayout()
718 tlog.Debug(tag, $"FlexLayoutOnLayout START");
720 flagOnLayoutOverride = false;
721 Assert.False(flagOnLayoutOverride, "flagOnLayoutOverride should be false initial");
723 LayoutItem layoutItem = new LinearLayout();
725 View view = new View()
727 ExcludeLayouting = false,
728 Size = new Size(100, 150),
729 Layout = new FlexLayout()
732 layoutItem.AttachToOwner(view);
734 var testingTarget = new MyFlexLayout();
735 Assert.IsNotNull(testingTarget, "null handle");
736 Assert.IsInstanceOf<FlexLayout>(testingTarget, "Should be an instance of FlexLayout type.");
738 testingTarget.AttachToOwner(view);
739 testingTarget.Add(layoutItem);
741 testingTarget.OnLayoutTest(true, new LayoutLength(5), new LayoutLength(5), new LayoutLength(10), new LayoutLength(10));
742 Assert.True(flagOnLayoutOverride, "FlexLayout overridden method not invoked.");
744 // Test with false parameter
745 flagOnLayoutOverride = false;
746 Assert.False(flagOnLayoutOverride, "flagOnLayoutOverride should be false initial");
747 testingTarget.OnLayoutTest(false, new LayoutLength(5), new LayoutLength(5), new LayoutLength(10), new LayoutLength(10));
748 Assert.True(flagOnLayoutOverride, "FlexLayout overridden method not invoked with false parameter.");
750 tlog.Debug(tag, $"FlexLayoutOnLayout END (OK)");