From 45318d9ae270c4b95a86dc4098cb3c3d49765e82 Mon Sep 17 00:00:00 2001 From: "guowei.wang" Date: Wed, 20 Apr 2022 11:48:15 +0800 Subject: [PATCH] [NUI] Update TCs to improve function coverage of NUI.Components. --- .../GlobalSuppressions.cs | 19 + .../Tizen.NUI.Components.Devel.Tests.csproj | 4 +- .../testcase/Controls/CheckBox.cs | 64 ++++ .../Controls/FlexibleView/TSFlexibleView.cs | 130 +++++++ .../FlexibleView/TSFlexibleViewLayoutManager.cs | 349 +++++++++++++++++ .../FlexibleView/TSFlexibleViewRecycler.cs | 62 +++ .../Controls/FlexibleView/TSOrientationHelper.cs | 210 +++++++++++ .../testcase/Controls/Navigation/TSAppBar.cs | 35 ++ .../RecyclerView/Layouter/TSGridLayouter.cs | 81 ++++ .../RecyclerView/Layouter/TSItemsLayouter.cs | 266 +++++++++++++ .../Controls/RecyclerView/TSRecyclerView.cs | 206 ++++++++++ .../RecyclerView/TSSelectionChangedEventArgs.cs | 60 +++ .../Controls/RecyclerView/TSSelectionList.cs | 243 ++++++++++++ .../testcase/Controls/TSButton.Internal.cs | 43 +++ .../testcase/Controls/TSButton.cs | 414 +++++++++++++++++++++ .../testcase/Controls/TSButtonGroup.cs | 279 ++++++++++++++ .../testcase/Controls/TSCheckBoxGroup.cs | 49 +++ .../testcase/Controls/TSDatePicker.cs | 227 ++++++----- .../testcase/Controls/TSImageScrollBar.cs | 42 +++ .../testcase/Controls/TSMenu.cs | 106 ++++++ .../testcase/Controls/TSPagination.cs | 34 -- .../testcase/Controls/TSRadioButton.cs | 4 +- .../testcase/Controls/TSScrollableBase.cs | 109 ++++++ .../testcase/Controls/TSSlider.cs | 234 +++++------- .../testcase/Controls/TSTimePicker.cs | 234 +++++------- .../testcase/Extension/TSLottieSwitchExtension.cs | 89 +++++ .../testcase/Extension/TSSlidingSwitchExtension.cs | 29 ++ .../testcase/Style/TSDatePickerStyle.cs | 106 ++++++ .../testcase/Style/TSDefaultGridItemStyle.cs | 120 ++++++ .../testcase/Style/TSDefaultLinearItemStyle.cs | 112 ++++++ .../testcase/Style/TSDefaultTitleItemStyle.cs | 112 ++++++ .../testcase/Style/TSSliderStyle.cs | 70 ++++ .../testcase/Utils/TSStyleManager.cs | 29 ++ 33 files changed, 3770 insertions(+), 401 deletions(-) create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/GlobalSuppressions.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/CheckBox.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleViewRecycler.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSOrientationHelper.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/Layouter/TSItemsLayouter.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSRecyclerView.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSSelectionChangedEventArgs.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSSelectionList.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/TSButton.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Style/TSDatePickerStyle.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Style/TSDefaultGridItemStyle.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Style/TSDefaultLinearItemStyle.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Style/TSDefaultTitleItemStyle.cs create mode 100755 test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Style/TSSliderStyle.cs diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/GlobalSuppressions.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/GlobalSuppressions.cs new file mode 100755 index 0000000..6d0ee61 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/GlobalSuppressions.cs @@ -0,0 +1,19 @@ +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterInitialize")] +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterRequestLayout")] +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterClear")] +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemInserted")] +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemRangeInserted")] +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemRemoved")] +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemRangeRemoved")] +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemMoved")] +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemRangeMoved")] +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterRequestNextFocusableView")] +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterGetVisibleItem")] +[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterGetItemSize")] diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/Tizen.NUI.Components.Devel.Tests.csproj b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/Tizen.NUI.Components.Devel.Tests.csproj index 10844e7..ac20da7 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/Tizen.NUI.Components.Devel.Tests.csproj +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/Tizen.NUI.Components.Devel.Tests.csproj @@ -25,10 +25,10 @@ - + Runtime - + diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/CheckBox.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/CheckBox.cs new file mode 100755 index 0000000..3e489ee --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/CheckBox.cs @@ -0,0 +1,64 @@ +using global::System; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.NUI; +using Tizen.NUI.Components; +using Tizen.NUI.BaseComponents; +using System.Threading.Tasks; + +namespace Tizen.NUI.Components.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [Description("Controls/CheckBox")] + class CheckBoxText + { + private const string tag = "NUITEST"; + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("CheckBox ItemGroup.")] + [Property("SPEC", "Tizen.NUI.Components.CheckBox.ItemGroup A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void CheckBoxItemGroup() + { + tlog.Debug(tag, $"CheckBoxItemGroup START"); + + CheckBox cb = new CheckBox() + { + Size = new Size(48, 48), + IsEnabled = true, + IsSelectable = true, + IsSelected = true, + }; + Assert.IsNotNull(cb, "null handle"); + Assert.IsInstanceOf(cb, "Should return CheckBox instance."); + + CheckBoxGroup cbGroup = new CheckBoxGroup(); + cbGroup.Add(cb); + + var testingTarget = cb.ItemGroup; + Assert.IsNotNull(testingTarget, "null handle"); + Assert.IsInstanceOf(testingTarget, "Should return CheckBoxGroup instance."); + + cb.Dispose(); + tlog.Debug(tag, $"CheckBoxItemGroup END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleView.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleView.cs index ccde026..d5f7eeb 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleView.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleView.cs @@ -55,6 +55,17 @@ namespace Tizen.NUI.Components.Devel.Tests throw new NotImplementedException(); } + internal class FlexibleViewImpl : FlexibleView + { + public FlexibleViewImpl() : base() + { } + + public void OnCreateViewStyle() + { + base.CreateViewStyle(); + } + } + [SetUp] public void Init() { @@ -504,5 +515,124 @@ namespace Tizen.NUI.Components.Devel.Tests scrollBar.Dispose(); tlog.Debug(tag, $"FlexibleViewDetachScrollBar END (OK)"); } + + [Test] + [Category("P1")] + [Description("FlexibleView CreateViewStyle.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleView.CreateViewStyle M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewCreateViewStyle() + { + tlog.Debug(tag, $"FlexibleViewCreateViewStyle START"); + + var testingTarget = new FlexibleViewImpl(); + Assert.IsNotNull(testingTarget, "null handle"); + Assert.IsInstanceOf(testingTarget, "Should return FlexibleView instance."); + + try + { + testingTarget.OnCreateViewStyle(); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewCreateViewStyle END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewItemClickedEventArgs ClickedView.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewItemClickedEventArgs.ClickedView A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "huayong.xu@samsung.com")] + public void FlexibleViewItemClickedEventArgsClickedView() + { + tlog.Debug(tag, $"FlexibleViewItemClickedEventArgsClickedView START"); + + var testingTarget = new FlexibleViewItemClickedEventArgs(); + Assert.IsNotNull(testingTarget, "null handle"); + Assert.IsInstanceOf(testingTarget, "Should return FlexibleViewItemClickedEventArgs instance."); + + using (View view = new View() { Size = new Size(100, 200) }) + { + FlexibleViewViewHolder holder = new FlexibleViewViewHolder(view); + testingTarget.ClickedView = holder; + tlog.Debug(tag, "ClickedView : " + testingTarget.ClickedView); + } + + tlog.Debug(tag, $"FlexibleViewItemClickedEventArgsClickedView END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleView.ChildHelper RemoveViewAt.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ChildHelper.RemoveViewAt M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "huayong.xu@samsung.com")] + public void FlexibleViewChildHelperRemoveViewAt() + { + tlog.Debug(tag, $"FlexibleViewChildHelperRemoveViewAt START"); + + FlexibleView owner = new FlexibleView() + { + Padding = new Extents(10, 10, 10, 10), + }; + + var testingTarget = new FlexibleView.ChildHelper(owner); + Assert.IsNotNull(testingTarget, "null handle"); + Assert.IsInstanceOf(testingTarget, "Should return FlexibleView.ChildHelper instance."); + + View view = new View() + { + Size = new Size(100, 200), + }; + FlexibleViewViewHolder holder = new FlexibleViewViewHolder(view); + + testingTarget.AttachView(holder, 0); + var result = testingTarget.RemoveViewAt(0); + tlog.Debug(tag, "RemoveViewAt : " + result); + + owner.Dispose(); + view.Dispose(); + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewChildHelperRemoveViewAt END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewItemTouchEventArgs TouchedView .")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewItemTouchEventArgs.TouchedView A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "huayong.xu@samsung.com")] + public void FlexibleViewItemTouchEventArgsTouchedView() + { + tlog.Debug(tag, $"FlexibleViewItemTouchEventArgsTouchedView START"); + + var testingTarget = new FlexibleViewItemTouchEventArgs(); + Assert.IsNotNull(testingTarget, "null handle"); + Assert.IsInstanceOf(testingTarget, "Should return FlexibleViewItemTouchEventArgs instance."); + + using (View view = new View() { Size = new Size(100, 200) }) + { + FlexibleViewViewHolder holder = new FlexibleViewViewHolder(view); + testingTarget.TouchedView = holder; + tlog.Debug(tag, "TouchedView : " + testingTarget.TouchedView); + } + + tlog.Debug(tag, $"FlexibleViewItemTouchEventArgsTouchedView END (OK)"); + } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleViewLayoutManager.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleViewLayoutManager.cs index 7801a6b..61a79d8 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleViewLayoutManager.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleViewLayoutManager.cs @@ -243,6 +243,72 @@ namespace Tizen.NUI.Components.Devel.Tests return horizontalFlexibleView; } + internal class FlexibleViewLayoutManagerImpl : FlexibleViewLayoutManager + { + public FlexibleViewLayoutManagerImpl() : base() + { } + + public override void OnLayoutChildren(FlexibleViewRecycler recycler) + { + throw new NotImplementedException(); + } + + protected override int GetNextPosition(int position, Direction direction) + { + throw new NotImplementedException(); + } + + public override bool CanScrollHorizontally() + { + return base.CanScrollHorizontally(); + } + + public override bool CanScrollVertically() + { + return base.CanScrollVertically(); + } + + public override float ScrollHorizontallyBy(float dy, FlexibleViewRecycler recycler, bool immediate) + { + return base.ScrollHorizontallyBy(dy, recycler, immediate); + } + + public override float ScrollVerticallyBy(float dy, FlexibleViewRecycler recycler, bool immediate) + { + return base.ScrollVerticallyBy(dy, recycler, immediate); + } + + public override float ComputeScrollExtent() + { + return base.ComputeScrollExtent(); + } + + public override float ComputeScrollOffset() + { + return base.ComputeScrollOffset(); + } + + public override float ComputeScrollRange() + { + return base.ComputeScrollRange(); + } + + public FlexibleViewViewHolder OnFindFirstVisibleItemView() + { + return base.FindFirstVisibleItemView(); + } + + public FlexibleViewViewHolder OnFindLastVisibleItemView() + { + return base.FindLastVisibleItemView(); + } + + internal override FlexibleViewViewHolder OnFocusSearchFailed(FlexibleViewViewHolder focused, FlexibleViewLayoutManager.Direction direction, FlexibleViewRecycler recycler) + { + return base.OnFocusSearchFailed(focused, direction, recycler); + } + } + [SetUp] public void Init() { @@ -354,5 +420,288 @@ namespace Tizen.NUI.Components.Devel.Tests tlog.Debug(tag, $"FlexibleViewLayoutManagerOffsetChildrenVertical END (OK)"); } + + [Test] + [Category("P1")] + [Description("FlexibleViewLayoutManager CanScrollHorizontally.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.CanScrollHorizontally M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewLayoutManagerCanScrollHorizontally() + { + tlog.Debug(tag, $"FlexibleViewLayoutManagerCanScrollHorizontally START"); + + var testingTarget = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + var result = horizontalLayoutManager.CanScrollHorizontally(); + tlog.Debug(tag, "CanScrollHorizontally : " + result); + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewLayoutManagerCanScrollHorizontally END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewLayoutManager CanScrollVertically.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.CanScrollVertically M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewLayoutManagerCanScrollVertically() + { + tlog.Debug(tag, $"FlexibleViewLayoutManagerCanScrollVertically START"); + + var testingTarget = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + var result = horizontalLayoutManager.CanScrollVertically(); + tlog.Debug(tag, "CanScrollVertically : " + result); + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewLayoutManagerCanScrollVertically END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewLayoutManager ScrollHorizontallyBy.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.ScrollHorizontallyBy M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewLayoutManagerScrollHorizontallyBy() + { + tlog.Debug(tag, $"FlexibleViewLayoutManagerScrollHorizontallyBy START"); + + var testingTarget = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + using (FlexibleView view = new FlexibleView() { Padding = new Extents(10, 10, 10, 10) }) + { + FlexibleViewRecycler recycler = new FlexibleViewRecycler(view); + var result = testingTarget.ScrollHorizontallyBy(1.0f, recycler, false); + tlog.Debug(tag, "ScrollHorizontallyBy : " + result); + } + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewLayoutManagerScrollHorizontallyBy END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewLayoutManager ScrollVerticallyBy.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.ScrollVerticallyBy M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewLayoutManagerScrollVerticallyBy() + { + tlog.Debug(tag, $"FlexibleViewLayoutManagerScrollVerticallyBy START"); + + var testingTarget = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + using (FlexibleView view = new FlexibleView() { Padding = new Extents(10, 10, 10, 10) }) + { + FlexibleViewRecycler recycler = new FlexibleViewRecycler(view); + var result = testingTarget.ScrollVerticallyBy(1.0f, recycler, false); + tlog.Debug(tag, "ScrollVerticallyBy : " + result); + } + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewLayoutManagerScrollVerticallyBy END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewLayoutManager ComputeScrollExtent.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.ComputeScrollExtent M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewLayoutManagerComputeScrollExtent() + { + tlog.Debug(tag, $"FlexibleViewLayoutManagerComputeScrollExtent START"); + + var testingTarget = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + var result = testingTarget.ComputeScrollExtent(); + tlog.Debug(tag, "ComputeScrollExtent : " + result); + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewLayoutManagerComputeScrollExtent END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewLayoutManager ComputeScrollOffset.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.ComputeScrollOffset M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewLayoutManagerComputeScrollOffset() + { + tlog.Debug(tag, $"FlexibleViewLayoutManagerComputeScrollOffset START"); + + var testingTarget = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + var result = testingTarget.ComputeScrollOffset(); + tlog.Debug(tag, "ComputeScrollOffset : " + result); + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewLayoutManagerComputeScrollOffset END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewLayoutManager ComputeScrollRange.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.ComputeScrollRange M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewLayoutManagerComputeScrollRange() + { + tlog.Debug(tag, $"FlexibleViewLayoutManagerComputeScrollRange START"); + + var testingTarget = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + var result = testingTarget.ComputeScrollRange(); + tlog.Debug(tag, "ComputeScrollRange : " + result); + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewLayoutManagerComputeScrollRange END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewLayoutManager RemoveAndRecycleViewAt.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.RemoveAndRecycleViewAt M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewLayoutManagerRemoveAndRecycleViewAt() + { + tlog.Debug(tag, $"FlexibleViewLayoutManagerRemoveAndRecycleViewAt START"); + + var testingTarget = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + using (FlexibleView view = new FlexibleView() { Padding = new Extents(10, 10, 10, 10) }) + { + FlexibleViewRecycler recycler = new FlexibleViewRecycler(view); + + try + { + testingTarget.RemoveAndRecycleViewAt(0, recycler); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + } + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewLayoutManagerRemoveAndRecycleViewAt END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewLayoutManager FindFirstVisibleItemView.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.FindFirstVisibleItemView M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewLayoutManagerFindFirstVisibleItemView() + { + tlog.Debug(tag, $"FlexibleViewLayoutManagerFindFirstVisibleItemView START"); + + var testingTarget = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + var result = testingTarget.OnFindFirstVisibleItemView(); + tlog.Debug(tag, "FindFirstVisibleItemView : " + result); + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewLayoutManagerFindFirstVisibleItemView END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewLayoutManager FindLastVisibleItemView.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.FindLastVisibleItemView M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewLayoutManagerFindLastVisibleItemView() + { + tlog.Debug(tag, $"FlexibleViewLayoutManagerFindLastVisibleItemView START"); + + var testingTarget = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + var result = testingTarget.OnFindLastVisibleItemView(); + tlog.Debug(tag, "FindLastVisibleItemView : " + result); + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewLayoutManagerFindLastVisibleItemView END (OK)"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewLayoutManager OnFocusSearchFailed.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.OnFocusSearchFailed M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewLayoutManagerOnFocusSearchFailed() + { + tlog.Debug(tag, $"FlexibleViewLayoutManagerOnFocusSearchFailed START"); + + var testingTarget = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + using (View view = new View() { Size = new Size(100, 200) }) + { + FlexibleViewViewHolder focused = new FlexibleViewViewHolder(view); + + using (FlexibleView recyclerView = new FlexibleView() { Padding = new Extents(10, 10, 10, 10) }) + { + FlexibleViewRecycler recycler = new FlexibleViewRecycler(recyclerView); + + var result = testingTarget.OnFocusSearchFailed(focused, FlexibleViewLayoutManager.Direction.Down, recycler); + tlog.Debug(tag, "OnFocusSearchFailed : " + result); + } + } + + testingTarget.Dispose(); + tlog.Debug(tag, $"FlexibleViewLayoutManagerOnFocusSearchFailed END (OK)"); + } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleViewRecycler.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleViewRecycler.cs new file mode 100755 index 0000000..d61227a --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSFlexibleViewRecycler.cs @@ -0,0 +1,62 @@ +using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.Components.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [Description("Controls/FlexibleView/FlexibleViewRecycler")] + public class FlexibleViewRecyclerTest + { + private const string tag = "NUITEST"; + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("FlexibleViewRecycler SetViewCacheSize.")] + [Property("SPEC", "Tizen.NUI.Components.FlexibleViewRecycler.SetViewCacheSize M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void FlexibleViewRecyclerSetViewCacheSize() + { + tlog.Debug(tag, $"FlexibleViewRecyclerSetViewCacheSize START"); + + using (FlexibleView recyclerView = new FlexibleView() { Padding = new Extents(10, 10, 10, 10) }) + { + var testingTarget = new FlexibleViewRecycler(recyclerView); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + try + { + testingTarget.SetViewCacheSize(5); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + } + + tlog.Debug(tag, $"FlexibleViewRecyclerSetViewCacheSize END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSOrientationHelper.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSOrientationHelper.cs new file mode 100755 index 0000000..28144f6 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/FlexibleView/TSOrientationHelper.cs @@ -0,0 +1,210 @@ +using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI.Components.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [Description("Controls/FlexibleView/OrientationHelper")] + public class OrientationHelperTest + { + private const string tag = "NUITEST"; + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + internal class OrientationHelperImpl : OrientationHelper + { + public OrientationHelperImpl(FlexibleViewLayoutManager layoutManager) : base(layoutManager) + { + + } + + public override float GetEnd() + { + throw new NotImplementedException(); + } + + public override float GetEndAfterPadding() + { + throw new NotImplementedException(); + } + + public override float GetEndPadding() + { + throw new NotImplementedException(); + } + + public override float GetStartAfterPadding() + { + throw new NotImplementedException(); + } + + public override float GetTotalSpace() + { + throw new NotImplementedException(); + } + + public override float GetViewHolderEnd(FlexibleViewViewHolder holder) + { + throw new NotImplementedException(); + } + + public override float GetViewHolderMeasurement(FlexibleViewViewHolder holder) + { + throw new NotImplementedException(); + } + + public override float GetViewHolderMeasurementInOther(FlexibleViewViewHolder holder) + { + return holder.Bottom - holder.Top; + } + + public override float GetViewHolderStart(FlexibleViewViewHolder holder) + { + throw new NotImplementedException(); + } + + public override void OffsetChildren(float amount, bool immediate) + { + throw new NotImplementedException(); + } + + internal override void OffsetChild(FlexibleViewViewHolder holder, int offset) + { + throw new NotImplementedException(); + } + } + + internal class FlexibleViewLayoutManagerImpl : FlexibleViewLayoutManager + { + public FlexibleViewLayoutManagerImpl() : base() + { } + + public override void OnLayoutChildren(FlexibleViewRecycler recycler) + { + throw new NotImplementedException(); + } + + protected override int GetNextPosition(int position, Direction direction) + { + throw new NotImplementedException(); + } + } + + [Test] + [Category("P1")] + [Description("OrientationHelper OnLayoutComplete.")] + [Property("SPEC", "Tizen.NUI.Components.OrientationHelper.OnLayoutComplete M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void OrientationHelperOnLayoutComplete() + { + tlog.Debug(tag, $"OrientationHelperOnLayoutComplete START"); + + FlexibleViewLayoutManager manager = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(manager, "should be not null"); + Assert.IsInstanceOf(manager, "should be an instance of testing target class!"); + + var testingTarget = new OrientationHelperImpl(manager); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + try + { + testingTarget.OnLayoutComplete(); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + + manager.Dispose(); + tlog.Debug(tag, $"OrientationHelperOnLayoutComplete END (OK)"); + } + + [Test] + [Category("P1")] + [Description("OrientationHelper GetTotalSpaceChange.")] + [Property("SPEC", "Tizen.NUI.Components.OrientationHelper.GetTotalSpaceChange M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void OrientationHelperGetTotalSpaceChange() + { + tlog.Debug(tag, $"OrientationHelperGetTotalSpaceChange START"); + + FlexibleViewLayoutManager manager = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(manager, "should be not null"); + Assert.IsInstanceOf(manager, "should be an instance of testing target class!"); + + var testingTarget = new OrientationHelperImpl(manager); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + try + { + var result = testingTarget.GetTotalSpaceChange(); + tlog.Debug(tag, "GetTotalSpaceChange : " + result); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + + manager.Dispose(); + tlog.Debug(tag, $"OrientationHelperGetTotalSpaceChange END (OK)"); + } + + [Test] + [Category("P1")] + [Description("OrientationHelper GetViewHolderMeasurementInOther.")] + [Property("SPEC", "Tizen.NUI.Components.OrientationHelper.GetViewHolderMeasurementInOther M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void OrientationHelperGetViewHolderMeasurementInOther() + { + tlog.Debug(tag, $"OrientationHelperGetViewHolderMeasurementInOther START"); + + FlexibleViewLayoutManager manager = new FlexibleViewLayoutManagerImpl(); + Assert.IsNotNull(manager, "should be not null"); + Assert.IsInstanceOf(manager, "should be an instance of testing target class!"); + + var testingTarget = new OrientationHelperImpl(manager); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + using (View view = new View() { Size = new Size(100, 200) }) + { + FlexibleViewViewHolder holder = new FlexibleViewViewHolder(view); + + var result = testingTarget.GetViewHolderMeasurementInOther(holder); + tlog.Debug(tag, "GetViewHolderMeasurementInOther : " + result); + } + + manager.Dispose(); + tlog.Debug(tag, $"OrientationHelperGetViewHolderMeasurementInOther END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/Navigation/TSAppBar.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/Navigation/TSAppBar.cs index 2df1bc3..bb599dc 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/Navigation/TSAppBar.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/Navigation/TSAppBar.cs @@ -25,6 +25,11 @@ namespace Tizen.NUI.Components.Devel.Tests { base.Dispose(types); } + + public void OnCreateViewStyle() + { + base.CreateViewStyle(); + } } [SetUp] @@ -123,5 +128,35 @@ namespace Tizen.NUI.Components.Devel.Tests tlog.Debug(tag, $"AppBarDispose END (OK)"); } + + [Test] + [Category("P1")] + [Description("AppBar CreateViewStyle.")] + [Property("SPEC", "Tizen.NUI.Components.AppBar.CreateViewStyle M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void AppBarCreateViewStyle() + { + tlog.Debug(tag, $"AppBarCreateViewStyle START"); + + var testingTarget = new MyAppBar(); + Assert.IsNotNull(testingTarget, "null handle"); + Assert.IsInstanceOf(testingTarget, "Should return AppBar instance."); + + try + { + testingTarget.OnCreateViewStyle(); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + + testingTarget.Dispose(); + tlog.Debug(tag, $"AppBarCreateViewStyle END (OK)"); + } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/Layouter/TSGridLayouter.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/Layouter/TSGridLayouter.cs index 695d124..76508ff 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/Layouter/TSGridLayouter.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/Layouter/TSGridLayouter.cs @@ -496,5 +496,86 @@ namespace Tizen.NUI.Components.Devel.Tests tlog.Debug(tag, $"GridLayouterRequestNextFocusableView END (OK)"); } + + [Test] + [Category("P1")] + [Description("GridLayouter GetVisibleItem.")] + [Property("SPEC", "Tizen.NUI.Components.GridLayouter.GetVisibleItem M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void GridLayouterGetVisibleItem() + { + tlog.Debug(tag, $"GridLayouterGetVisibleItem START"); + + var view = new CollectionView(new List() { "123" }) // 4. Get item if visible or realize new. + { + Header = new RecyclerViewItem(), + Footer = new RecyclerViewItem(), + IsGrouped = true, + }; + Assert.IsNotNull(view, "Should not be null"); + + view.GroupFooterTemplate = new DataTemplate(typeof(RecyclerViewItem)); + view.GroupHeaderTemplate = new DataTemplate(typeof(RecyclerViewItem)); + view.ItemTemplate = new DataTemplate(typeof(RecyclerViewItem)); + + var gridLayouter = new GridLayouter(); + Assert.IsNotNull(gridLayouter, "Should not be null"); + + gridLayouter.Initialize(view); + + gridLayouter.RequestLayout(5.0f); + gridLayouter.RequestLayout(150.0f, true); + + view.Dispose(); + gridLayouter.Dispose(); + + tlog.Debug(tag, $"GridLayouterGetVisibleItem END (OK)"); + } + + [Test] + [Category("P1")] + [Description("GridLayouter GetItemSize.")] + [Property("SPEC", "Tizen.NUI.Components.GridLayouter.GetItemSize M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void GridLayouterGetItemSize() + { + tlog.Debug(tag, $"GridLayouterGetItemSize START"); + + var view = new CollectionView(new List() { "123", "456", "789" }) + { + Header = new RecyclerViewItem(), + Footer = new RecyclerViewItem(), + IsGrouped = true, + }; + Assert.IsNotNull(view, "Should not be null"); + + view.GroupFooterTemplate = new DataTemplate(typeof(RecyclerViewItem)); + view.GroupHeaderTemplate = new DataTemplate(typeof(RecyclerViewItem)); + view.ItemTemplate = new DataTemplate(typeof(RecyclerViewItem)); + + var gridLayouter = new GridLayouter(); + Assert.IsNotNull(gridLayouter, "Should not be null"); + + gridLayouter.Initialize(view); + + try + { + gridLayouter.GetItemSize(1); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + + view.Dispose(); + gridLayouter.Dispose(); + + tlog.Debug(tag, $"GridLayouterGetItemSize END (OK)"); + } } } diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/Layouter/TSItemsLayouter.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/Layouter/TSItemsLayouter.cs new file mode 100755 index 0000000..ecb44fa --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/Layouter/TSItemsLayouter.cs @@ -0,0 +1,266 @@ +using global::System; +using NUnit.Framework; +using NUnit.Framework.TUnit; +using Tizen.NUI; +using Tizen.NUI.Components; +using Tizen.NUI.BaseComponents; +using System.Collections.Generic; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [Description("Controls/RecyclerView/Layouter")] + public class ItemsLayouterTest + { + private const string tag = "NUITEST"; + + internal class ItemsLayouterImpl : ItemsLayouter + { + public ItemsLayouterImpl() : base() + { } + + public override float CalculateLayoutOrientationSize() + { + return base.CalculateLayoutOrientationSize(); + } + + public override float CalculateCandidateScrollPosition(float scrollPosition) + { + return base.CalculateCandidateScrollPosition(scrollPosition); + } + + public override void NotifyDataSetChanged() + { + base.NotifyDataSetChanged(); + } + } + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("ItemsLayouter CalculateLayoutOrientationSize.")] + [Property("SPEC", "Tizen.NUI.Components.ItemsLayouter.CalculateLayoutOrientationSize M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void ItemsLayouterCalculateLayoutOrientationSize() + { + tlog.Debug(tag, $"ItemsLayouterCalculateLayoutOrientationSize START"); + + var view = new CollectionView(new List() { "123", "456", "789" }) + { + Header = new RecyclerViewItem(), + Footer = new RecyclerViewItem(), + IsGrouped = true, + }; + Assert.IsNotNull(view, "Should not be null"); + +#pragma warning disable Reflection // The code contains reflection + view.GroupFooterTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection +#pragma warning disable Reflection // The code contains reflection + view.GroupHeaderTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection +#pragma warning disable Reflection // The code contains reflection + view.ItemTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection + + var itemsLayouter = new ItemsLayouterImpl(); + Assert.IsNotNull(itemsLayouter, "Should not be null"); + + itemsLayouter.Initialize(view); + + try + { + itemsLayouter.CalculateLayoutOrientationSize(); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + + view.Dispose(); + itemsLayouter.Dispose(); + + tlog.Debug(tag, $"ItemsLayouterCalculateLayoutOrientationSize END (OK)"); + } + + [Test] + [Category("P1")] + [Description("ItemsLayouter CalculateCandidateScrollPosition.")] + [Property("SPEC", "Tizen.NUI.Components.ItemsLayouter.CalculateCandidateScrollPosition M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void ItemsLayouterCalculateCandidateScrollPosition() + { + tlog.Debug(tag, $"ItemsLayouterCalculateCandidateScrollPosition START"); + + var view = new CollectionView(new List() { "123", "456", "789" }) + { + Header = new RecyclerViewItem(), + Footer = new RecyclerViewItem(), + IsGrouped = true, + }; + Assert.IsNotNull(view, "Should not be null"); + +#pragma warning disable Reflection // The code contains reflection + view.GroupFooterTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection +#pragma warning disable Reflection // The code contains reflection + view.GroupHeaderTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection +#pragma warning disable Reflection // The code contains reflection + view.ItemTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection + + var itemsLayouter = new ItemsLayouterImpl(); + Assert.IsNotNull(itemsLayouter, "Should not be null"); + + itemsLayouter.Initialize(view); + + try + { + itemsLayouter.CalculateCandidateScrollPosition(0.3f); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + + view.Dispose(); + itemsLayouter.Dispose(); + + tlog.Debug(tag, $"ItemsLayouterCalculateCandidateScrollPosition END (OK)"); + } + + [Test] + [Category("P1")] + [Description("ItemsLayouter NotifyDataSetChanged.")] + [Property("SPEC", "Tizen.NUI.Components.ItemsLayouter.NotifyDataSetChanged M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void ItemsLayouterNotifyDataSetChanged() + { + tlog.Debug(tag, $"ItemsLayouterNotifyDataSetChanged START"); + + var view = new CollectionView(new List() { "123", "456", "789" }) + { + Header = new RecyclerViewItem(), + Footer = new RecyclerViewItem(), + IsGrouped = true, + }; + Assert.IsNotNull(view, "Should not be null"); + +#pragma warning disable Reflection // The code contains reflection + view.GroupFooterTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection +#pragma warning disable Reflection // The code contains reflection + view.GroupHeaderTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection +#pragma warning disable Reflection // The code contains reflection + view.ItemTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection + + var itemsLayouter = new ItemsLayouterImpl(); + Assert.IsNotNull(itemsLayouter, "Should not be null"); + + itemsLayouter.Initialize(view); + + try + { + itemsLayouter.NotifyDataSetChanged(); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + + view.Dispose(); + itemsLayouter.Dispose(); + + tlog.Debug(tag, $"ItemsLayouterNotifyDataSetChanged END (OK)"); + } + + [Test] + [Category("P1")] + [Description("ItemsLayouter RequestNextFocusableView.")] + [Property("SPEC", "Tizen.NUI.Components.ItemsLayouter.RequestNextFocusableView M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "xiaohui.fang@samsung.com")] + public void ItemsLayouterRequestNextFocusableView() + { + tlog.Debug(tag, $"ItemsLayouterRequestNextFocusableView"); + + var view = new CollectionView(new List() { "123", "456" }) + { + Header = new RecyclerViewItem(), + Footer = new RecyclerViewItem(), + IsGrouped = true, + }; + Assert.IsNotNull(view, "Should not be null"); + +#pragma warning disable Reflection // The code contains reflection + view.GroupFooterTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection +#pragma warning disable Reflection // The code contains reflection + view.GroupHeaderTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection +#pragma warning disable Reflection // The code contains reflection + view.ItemTemplate = new DataTemplate(typeof(RecyclerViewItem)); +#pragma warning restore Reflection // The code contains reflection + + var itemsLayouter = new ItemsLayouterImpl(); + Assert.IsNotNull(itemsLayouter, "Should not be null"); + + itemsLayouter.Initialize(view); + itemsLayouter.RequestLayout(100.0f); + + var source = new CustomGroupItemSource(view) + { + Position = 1, + }; + + var orientationSize = itemsLayouter.CalculateLayoutOrientationSize(); + tlog.Debug(tag, "orientationSize : " + orientationSize); + + var scrollPosition = itemsLayouter.CalculateCandidateScrollPosition(0.0f); + tlog.Debug(tag, "scrollPosition : " + scrollPosition); + + itemsLayouter.NotifyItemRangeInserted(source, 0, 10); + + itemsLayouter.RequestNextFocusableView(view, View.FocusDirection.Up, true); + itemsLayouter.RequestNextFocusableView(view, View.FocusDirection.Down, true); + itemsLayouter.RequestNextFocusableView(view, View.FocusDirection.PageUp, true); + itemsLayouter.RequestNextFocusableView(view, View.FocusDirection.PageDown, true); + itemsLayouter.RequestNextFocusableView(view, View.FocusDirection.Left, true); + itemsLayouter.RequestNextFocusableView(view, View.FocusDirection.Right, true); + + view.Dispose(); + itemsLayouter.Dispose(); + + source.Dispose(); + + tlog.Debug(tag, $"ItemsLayouterRequestNextFocusableView END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSRecyclerView.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSRecyclerView.cs new file mode 100755 index 0000000..59fa583 --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSRecyclerView.cs @@ -0,0 +1,206 @@ +using NUnit.Framework; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [NUnit.Framework.Description("Controls/RecyclerView/RecyclerView")] + class RecyclerViewTest + { + private const string tag = "NUITEST"; + public List Source { get; private set; } = new List(); + + public void CreateTestSource(int count) + { + var Rand = new Random(); + + for (int i = 0; i < count; i++) + Source.Add(new TestItem(i, $"Test Item [{i}]", new Color(((float)(Rand.Next(255)) / 255), ((float)(Rand.Next(255)) / 255), ((float)(Rand.Next(255)) / 255), 1))); + } + + internal class RecyclerViewImpl : RecyclerView + { + public RecyclerViewImpl() : base() + { } + + public float OnAdjustTargetPositionOfScrollAnimation(float position) + { + return base.AdjustTargetPositionOfScrollAnimation(position); + } + } + + internal class TestItem + { + int index; + string name; + Color color; + bool isSelected; + + public TestItem(int itemIndex, string itemName, Color itemColor) + { + Index = itemIndex; + Name = itemName; + BgColor = itemColor; + IsSelected = false; + } + + public int Index + { + get => index; + set { index = value; } + } + + public string Name + { + get => name; + set { name = value; } + } + + public Color BgColor + { + get => color; + set { color = value; } + } + + public bool IsSelected + { + get => isSelected; + set { isSelected = value; } + } + } + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("RecyclerView ItemsSource.")] + [Property("SPEC", "Tizen.NUI.Components.RecyclerView.ItemsSource A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void RecyclerViewItemsSource() + { + tlog.Debug(tag, $"RecyclerViewItemsSource START"); + + var testingTarget = new RecyclerViewImpl() + { + Size = new Size(Window.Instance.WindowSize.Width, Window.Instance.WindowSize.Height), + }; + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + CreateTestSource(50); + testingTarget.ItemsSource = Source; + tlog.Debug(tag, "ItemSouce : " + testingTarget.ItemsSource); + + testingTarget.ItemTemplate = new DataTemplate(() => + { + var item = new RecyclerViewItem() + { + HeightSpecification = LayoutParamPolicies.MatchParent, + WidthSpecification = 200, + }; + item.SetBinding(View.BackgroundColorProperty, "BgColor"); + + var label = new TextLabel() + { + ParentOrigin = Tizen.NUI.ParentOrigin.Center, + PivotPoint = Tizen.NUI.PivotPoint.Center, + PositionUsesPivotPoint = true, + }; + label.PixelSize = 30; + label.SetBinding(TextLabel.TextProperty, "Index"); + item.Add(label); + + return item; + }); + tlog.Debug(tag, "ItemTemplate : " + testingTarget.ItemTemplate); + + // OnRelayout + CreateTestSource(100); + testingTarget.ItemsSource = Source; + tlog.Debug(tag, "ItemSouce : " + testingTarget.ItemsSource); + + testingTarget.Dispose(); + tlog.Debug(tag, $"RecyclerViewItemsSource END (OK)"); + } + + [Test] + [Category("P1")] + [Description("RecyclerView AdjustTargetPositionOfScrollAnimation.")] + [Property("SPEC", "Tizen.NUI.Components.RecyclerView.AdjustTargetPositionOfScrollAnimation M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void RecyclerViewAdjustTargetPositionOfScrollAnimation() + { + tlog.Debug(tag, $"RecyclerViewAdjustTargetPositionOfScrollAnimation START"); + + var testingTarget = new RecyclerViewImpl() + { + Size = new Size(Window.Instance.WindowSize.Width, Window.Instance.WindowSize.Height), + }; + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + CreateTestSource(50); + testingTarget.ItemsSource = Source; + tlog.Debug(tag, "ItemSouce : " + testingTarget.ItemsSource); + + testingTarget.ItemTemplate = new DataTemplate(() => + { + var item = new RecyclerViewItem() + { + HeightSpecification = LayoutParamPolicies.MatchParent, + WidthSpecification = 200, + }; + item.SetBinding(View.BackgroundColorProperty, "BgColor"); + + var label = new TextLabel() + { + ParentOrigin = Tizen.NUI.ParentOrigin.Center, + PivotPoint = Tizen.NUI.PivotPoint.Center, + PositionUsesPivotPoint = true, + }; + label.PixelSize = 30; + label.SetBinding(TextLabel.TextProperty, "Index"); + item.Add(label); + + return item; + }); + tlog.Debug(tag, "ItemTemplate : " + testingTarget.ItemTemplate); + + try + { + testingTarget.OnAdjustTargetPositionOfScrollAnimation(300.0f); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + + testingTarget.Dispose(); + tlog.Debug(tag, $"RecyclerViewAdjustTargetPositionOfScrollAnimation END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSSelectionChangedEventArgs.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSSelectionChangedEventArgs.cs new file mode 100755 index 0000000..95a9aac --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSSelectionChangedEventArgs.cs @@ -0,0 +1,60 @@ +using NUnit.Framework; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Text; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [NUnit.Framework.Description("Controls/RecyclerView/SelectionChangedEventArgs")] + public class SelectionChangedEventArgsTest + { + private const string tag = "NUITEST"; + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("SelectionChangedEventArgs PreviousSelection .")] + [Property("SPEC", "Tizen.NUI.Components.SelectionChangedEventArgs.PreviousSelection A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void SelectionChangedEventArgsPreviousSelection() + { + tlog.Debug(tag, $"SelectionChangedEventArgsPreviousSelection START"); + + List list = new List(); + list.Add("Russia"); + list.Add("Ukraine"); + list.Add("America"); + + var testingTarget = new SelectionChangedEventArgs(list[1], list[2]); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + tlog.Debug(tag, "PreviousSelection : " + testingTarget.PreviousSelection); + tlog.Debug(tag, "CurrentSelection : " + testingTarget.CurrentSelection); + + tlog.Debug(tag, $"SelectionChangedEventArgsPreviousSelection END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSSelectionList.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSSelectionList.cs new file mode 100755 index 0000000..6c7ed7b --- /dev/null +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/RecyclerView/TSSelectionList.cs @@ -0,0 +1,243 @@ +using NUnit.Framework; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Text; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.Components.Devel.Tests +{ + using tlog = Tizen.Log; + + [TestFixture] + [NUnit.Framework.Description("Controls/RecyclerView/SelectionList")] + public class SelectionListTest + { + private const string tag = "NUITEST"; + private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { } + + private class TestModel : ObservableCollection + { + private string[] namePool = { + "Cat", + "Boy", + "Arm muscle", + "Girl", + "House", + "Cafe", + "Statue", + "Sea", + "hosepipe", + "Police", + "Rainbow", + "Icicle", + "Tower with the Moon", + "Giraffe", + "Camel", + "Zebra", + "Red Light", + "Banana", + "Lion", + "Espresso", + }; + + public TestModel() + { + CreateData(this, 20); + } + + private ObservableCollection CreateData(ObservableCollection result, int count) + { + for (int i = 0; i < count; i++) + { + result.Add(namePool[i % 20]); + } + return result; + } + } + + private DataTemplate testDataTemplate; + + internal class NCImpl : INotifyCollectionChanged + { + public event NotifyCollectionChangedEventHandler CollectionChanged; + } + + [SetUp] + public void Init() + { + tlog.Info(tag, "Init() is called!"); + + testDataTemplate = new DataTemplate(() => + { + var rand = new Random(); + DefaultLinearItem item = new DefaultLinearItem(); + //Set Width Specification as MatchParent to fit the Item width with parent View. + item.WidthSpecification = LayoutParamPolicies.MatchParent; + + //Decorate Label + item.Label.SetBinding(TextLabel.TextProperty, "ViewLabel"); + item.Label.HorizontalAlignment = HorizontalAlignment.Begin; + + //Decorate SubLabel + if ((rand.Next() % 2) == 0) + { + item.SubLabel.SetBinding(TextLabel.TextProperty, "Name"); + item.SubLabel.HorizontalAlignment = HorizontalAlignment.Begin; + } + + return item; + }); + } + + [TearDown] + public void Destroy() + { + tlog.Info(tag, "Destroy() is called!"); + } + + [Test] + [Category("P1")] + [Description("SelectionList Contains.")] + [Property("SPEC", "Tizen.NUI.Components.SelectionList.Contains M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void SelectionListContains() + { + tlog.Debug(tag, $"SelectionListContains START"); + + var model = new TestModel(); + + using (CollectionView cv = new CollectionView(model)) + { + var testingTarget = new SelectionList(cv); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + tlog.Debug(tag, "IsReadOnly : " + testingTarget.IsReadOnly.ToString()); + + try + { + testingTarget.Add("TEST"); + var result = testingTarget.Contains("TEST"); + tlog.Debug(tag, "Contains : " + result); + } + catch (Exception e) + { + tlog.Debug(tag, e.Message.ToString()); + Assert.Fail("Caught Exception : Failed!"); + } + } + + tlog.Debug(tag, $"SelectionListContains END (OK)"); + } + + [Test] + [Category("P1")] + [Description("SelectionList CopyTo.")] + [Property("SPEC", "Tizen.NUI.Components.SelectionList.CopyTo M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void SelectionListCopyTo() + { + tlog.Debug(tag, $"SelectionListCopyTo START"); + + var model = new TestModel(); + string[] list = { "Jiangsu", "Zhejiang", "Shanghai" }; + + using (CollectionView cv = new CollectionView(model)) + { + var testingTarget = new SelectionList(cv); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + testingTarget.CopyTo(list, 1); + + var result = testingTarget.Remove("Zhejiang"); + tlog.Debug(tag, "Remove : " + result); + + testingTarget.Insert(0, "Beijing"); + tlog.Debug(tag, "Contains : " + testingTarget.Contains("Beijing")); + + testingTarget.RemoveAt(0); + tlog.Debug(tag, "Contains : " + testingTarget.Contains("Beijing")); + } + + tlog.Debug(tag, $"SelectionListCopyTo END (OK)"); + } + + [Test] + [Category("P1")] + [Description("SelectionList OnCollectionChanged.")] + [Property("SPEC", "Tizen.NUI.Components.SelectionList.OnCollectionChanged M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void SelectionListOnCollectionChanged() + { + tlog.Debug(tag, $"SelectionListOnCollectionChanged START"); + + var model = new TestModel(); + string[] list = { "Jiangsu", "Zhejiang", "Shanghai" }; + + var incc = new NCImpl(); + incc.CollectionChanged += OnCollectionChanged; + + List item = new List(); + item.Add(item); + + using (CollectionView cv = new CollectionView(model)) + { + var testingTarget = new SelectionList(cv, item); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + testingTarget.Insert(0, "Beijing"); + tlog.Debug(tag, "Contains : " + testingTarget.Contains("Beijing")); + } + + tlog.Debug(tag, $"SelectionListOnCollectionChanged END (OK)"); + } + + [Test] + [Category("P1")] + [Description("SelectionList GetEnumerator.")] + [Property("SPEC", "Tizen.NUI.Components.SelectionList.GetEnumerator M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public void SelectionListGetEnumerator() + { + tlog.Debug(tag, $"SelectionListGetEnumerator START"); + + var model = new TestModel(); + string[] list = { "Jiangsu", "Zhejiang", "Shanghai" }; + + using (CollectionView cv = new CollectionView(model)) + { + var testingTarget = new SelectionList(cv); + Assert.IsNotNull(testingTarget, "should be not null"); + Assert.IsInstanceOf(testingTarget, "should be an instance of testing target class!"); + + testingTarget.Insert(0, "China"); + + var index = testingTarget.IndexOf("China"); + tlog.Debug(tag, "IndexOf : " + index); + + var result = testingTarget.GetEnumerator(); + tlog.Debug(tag, "Enumerator : " + result); + } + + tlog.Debug(tag, $"SelectionListGetEnumerator END (OK)"); + } + } +} diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/TSButton.Internal.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/TSButton.Internal.cs index ca3c935..0a8b1a6 100755 --- a/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/TSButton.Internal.cs +++ b/test/Tizen.NUI.Tests/Tizen.NUI.Components.Devel.Tests/testcase/Controls/TSButton.Internal.cs @@ -180,5 +180,48 @@ namespace Tizen.NUI.Components.Devel.Tests testingTarget.Dispose(); tlog.Debug(tag, $"ButtonOnRelayout END (OK)"); } + + [Test] + [Category("P2")] + [Description("Button OnRelayout.")] + [Property("SPEC", "Tizen.NUI.Components.Button.OnRelayout M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "guowei.wang@samsung.com")] + public async Task ButtonOnRelayoutOriginalSize() + { + tlog.Debug(tag, $"ButtonOnRelayoutOriginalSize START"); + + var testingTarget = new MyButton() + { + Text = "Button", + Size = new Size(100, 200), + BackgroundColor = Color.Green, + IsEnabled = true, + IconURL = image_path, + IconPadding = 4, + IconRelativeOrientation = Button.IconOrientation.Right + }; + Assert.IsNotNull(testingTarget, "null handle"); + Assert.IsInstanceOf