--- /dev/null
+// 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 = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterInitialize")]
+[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterRequestLayout")]
+[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterClear")]
+[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemInserted")]
+[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemRangeInserted")]
+[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemRemoved")]
+[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemRangeRemoved")]
+[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemMoved")]
+[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterNotifyItemRangeMoved")]
+[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterRequestNextFocusableView")]
+[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterGetVisibleItem")]
+[assembly: SuppressMessage("Security", "Reflection:The code contains reflection", Justification = "<Pending>", Scope = "member", Target = "~M:Tizen.NUI.Components.Devel.Tests.TSGridLayouter.GridLayouterGetItemSize")]
<Import Project="..\Common\dependencies.props" />
<ItemGroup>
- <PackageReference Include="Tizen.NET" Version="$(TizenNETVersion)">
+ <PackageReference Include="Tizen.NET" Version="10.0.0.17099">
<ExcludeAssets>Runtime</ExcludeAssets>
</PackageReference>
- <PackageReference Include="Tizen.NET.Sdk" Version="$(TizenNETSdkVersion)" />
+ <PackageReference Include="Tizen.NET.Sdk" Version="1.1.6" />
</ItemGroup>
<!-- Include Nuget Package for Tizen Project building -->
--- /dev/null
+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<CheckBox>(cb, "Should return CheckBox instance.");
+
+ CheckBoxGroup cbGroup = new CheckBoxGroup();
+ cbGroup.Add(cb);
+
+ var testingTarget = cb.ItemGroup;
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<CheckBoxGroup>(testingTarget, "Should return CheckBoxGroup instance.");
+
+ cb.Dispose();
+ tlog.Debug(tag, $"CheckBoxItemGroup END (OK)");
+ }
+ }
+}
throw new NotImplementedException();
}
+ internal class FlexibleViewImpl : FlexibleView
+ {
+ public FlexibleViewImpl() : base()
+ { }
+
+ public void OnCreateViewStyle()
+ {
+ base.CreateViewStyle();
+ }
+ }
+
[SetUp]
public void Init()
{
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<FlexibleView>(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<FlexibleViewItemClickedEventArgs>(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<FlexibleView.ChildHelper>(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<FlexibleViewItemTouchEventArgs>(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)");
+ }
}
}
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()
{
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<FlexibleViewLayoutManager>(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<FlexibleViewLayoutManager>(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<FlexibleViewLayoutManager>(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<FlexibleViewLayoutManager>(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<FlexibleViewLayoutManager>(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<FlexibleViewLayoutManager>(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<FlexibleViewLayoutManager>(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<FlexibleViewLayoutManager>(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<FlexibleViewLayoutManager>(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<FlexibleViewLayoutManager>(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<FlexibleViewLayoutManager>(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)");
+ }
}
}
--- /dev/null
+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<FlexibleViewRecycler>(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)");
+ }
+ }
+}
--- /dev/null
+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<FlexibleViewLayoutManager>(manager, "should be an instance of testing target class!");
+
+ var testingTarget = new OrientationHelperImpl(manager);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<OrientationHelper>(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<FlexibleViewLayoutManager>(manager, "should be an instance of testing target class!");
+
+ var testingTarget = new OrientationHelperImpl(manager);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<OrientationHelper>(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<FlexibleViewLayoutManager>(manager, "should be an instance of testing target class!");
+
+ var testingTarget = new OrientationHelperImpl(manager);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<OrientationHelper>(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)");
+ }
+ }
+}
{
base.Dispose(types);
}
+
+ public void OnCreateViewStyle()
+ {
+ base.CreateViewStyle();
+ }
}
[SetUp]
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<AppBar>(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)");
+ }
}
}
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<string>() { "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<string>() { "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)");
+ }
}
}
--- /dev/null
+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<string>() { "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<string>() { "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<string>() { "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<string>() { "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)");
+ }
+ }
+}
--- /dev/null
+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<TestItem> Source { get; private set; } = new List<TestItem>();
+
+ 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<RecyclerView>(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<RecyclerView>(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)");
+ }
+ }
+}
--- /dev/null
+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<string> list = new List<string>();
+ 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<SelectionChangedEventArgs>(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)");
+ }
+ }
+}
--- /dev/null
+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<string>
+ {
+ 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<string> CreateData(ObservableCollection<string> 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<SelectionList>(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<SelectionList>(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<object> item = new List<object>();
+ item.Add(item);
+
+ using (CollectionView cv = new CollectionView(model))
+ {
+ var testingTarget = new SelectionList(cv, item);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<SelectionList>(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<SelectionList>(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)");
+ }
+ }
+}
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<Button>(testingTarget, "Should return Button instance.");
+
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(testingTarget);
+
+ try
+ {
+ testingTarget.Size = new Size(100, 200);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ }
+
+ await Task.Delay(200);
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Remove(testingTarget);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ButtonOnRelayoutOriginalSize END (OK)");
+ }
}
}
--- /dev/null
+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.testcase.Controls
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Controls/Button")]
+ class ButtonTest
+ {
+ private const string tag = "NUITEST";
+ private string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+
+ [Obsolete]
+ private void OnStateChangedEvent(object sender, Button.StateChangedEventArgs e) { }
+
+ internal class MyButton : Button
+ {
+ public MyButton() : base()
+ { }
+
+ public override bool OnKey(Key key)
+ {
+ return base.OnKey(key);
+ }
+
+ public override void OnFocusGained()
+ {
+ base.OnFocusGained();
+ }
+
+ public override void OnFocusLost()
+ {
+ base.OnFocusLost();
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Button StateChangedEvent.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.StateChangedEvent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Obsolete]
+ public void ButtonStateChangedEvent()
+ {
+ tlog.Debug(tag, $"ButtonStateChangedEvent 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<Button>(testingTarget, "Should return Button instance.");
+
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(testingTarget);
+
+ testingTarget.StateChangedEvent += OnStateChangedEvent;
+ testingTarget.StateChangedEvent -= OnStateChangedEvent;
+
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Remove(testingTarget);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ButtonStateChangedEvent END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Button OverlayImage.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.OverlayImage A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ButtonOverlayImage()
+ {
+ tlog.Debug(tag, $"ButtonOverlayImage 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<Button>(testingTarget, "Should return Button instance.");
+
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(testingTarget);
+
+ testingTarget.OverlayImage.Border = new Rectangle(5, 5, 5, 5);
+ tlog.Debug(tag, "testingTarget.OverlayImage.Border : " + testingTarget.OverlayImage.Border);
+
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Remove(testingTarget);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ButtonOverlayImage END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Button TextLabel.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.TextLabel A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ButtonTextLabel()
+ {
+ tlog.Debug(tag, $"ButtonTextLabel 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<Button>(testingTarget, "Should return Button instance.");
+
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(testingTarget);
+
+ testingTarget.TextLabel.PointSize = 20.0f;
+ tlog.Debug(tag, "testingTarget.TextLabel.PointSize : " + testingTarget.TextLabel.PointSize);
+
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Remove(testingTarget);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ButtonTextLabel END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Button TranslatableText.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.TranslatableText A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ButtonTranslatableText()
+ {
+ tlog.Debug(tag, $"ButtonTranslatableText 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<Button>(testingTarget, "Should return Button instance.");
+
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(testingTarget);
+
+ testingTarget.TranslatableText = "TranslatableText";
+ tlog.Debug(tag, "testingTarget.TranslatableText : " + testingTarget.TranslatableText);
+
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Remove(testingTarget);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ButtonTranslatableText END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Button IconSize.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.IconSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ButtonIconSize()
+ {
+ tlog.Debug(tag, $"ButtonIconSize 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<Button>(testingTarget, "Should return Button instance.");
+
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(testingTarget);
+
+ testingTarget.IconSize = new Size(100, 200);
+ tlog.Debug(tag, "testingTarget.IconSize.Width : " + testingTarget.IconSize.Width);
+
+ NUIApplication.GetDefaultWindow().GetDefaultLayer().Remove(testingTarget);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ButtonIconSize END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Button OnKey.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.OnKey M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Obsolete]
+ public void ButtonOnKey()
+ {
+ tlog.Debug(tag, $"ButtonOnKey START");
+
+ var testingTarget = new MyButton();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Button>(testingTarget, "Should return Button instance.");
+
+ testingTarget.IsEnabled = true;
+ testingTarget.IsSelected = true;
+
+ Key key = null;
+ var result = testingTarget.OnKey(key);
+ Assert.AreEqual(false, result, "should be equal here!");
+
+ key = new Key()
+ {
+ State = Key.StateType.Up,
+ KeyPressedName = "Return"
+ };
+ result = testingTarget.OnKey(key);
+ tlog.Debug(tag, "OnKey : " + result);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ButtonOnKey END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Button OnKey.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.OnKey M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Obsolete]
+ public void ButtonOnKeyIsSelectableAsFalse()
+ {
+ tlog.Debug(tag, $"ButtonOnKeyIsSelectableAsFalse START");
+
+ var testingTarget = new MyButton();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Button>(testingTarget, "Should return Button instance.");
+
+ testingTarget.IsEnabled = true;
+ testingTarget.IsSelected = false;
+
+ Key key = null;
+ var result = testingTarget.OnKey(key);
+ Assert.AreEqual(false, result, "should be equal here!");
+
+ key = new Key()
+ {
+ State = Key.StateType.Up,
+ KeyPressedName = "Return"
+ };
+ result = testingTarget.OnKey(key);
+ tlog.Debug(tag, "OnKey : " + result);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ButtonOnKeyIsSelectableAsFalse END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Button OnKey.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.OnKey M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Obsolete]
+ public void ButtonOnKeyIsEnabledAsFalse()
+ {
+ tlog.Debug(tag, $"ButtonOnKeyIsEnabledAsFalse START");
+
+ var testingTarget = new MyButton();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Button>(testingTarget, "Should return Button instance.");
+
+ testingTarget.IsEnabled = false;
+ testingTarget.IsSelected = false;
+
+ Key key = null;
+ var result = testingTarget.OnKey(key);
+ Assert.AreEqual(false, result, "should be equal here!");
+
+ key = new Key()
+ {
+ State = Key.StateType.Up,
+ KeyPressedName = "Return"
+ };
+ result = testingTarget.OnKey(key);
+ tlog.Debug(tag, "OnKey : " + result);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ButtonOnKeyIsEnabledAsFalse END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Button OnFocusGained.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.OnFocusGained M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Obsolete]
+ public void ButtonOnFocusGained()
+ {
+ tlog.Debug(tag, $"ButtonOnFocusGained START");
+
+ var testingTarget = new MyButton();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Button>(testingTarget, "Should return Button instance.");
+
+ testingTarget.IsEnabled = true;
+ testingTarget.IsSelected = true;
+ testingTarget.Focusable = true;
+
+ try
+ {
+ testingTarget.OnFocusGained();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ButtonOnFocusGained END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Button OnFocusLost.")]
+ [Property("SPEC", "Tizen.NUI.Components.Button.OnFocusLost M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Obsolete]
+ public void ButtonOnFocusLost()
+ {
+ tlog.Debug(tag, $"ButtonOnFocusLost START");
+
+ var testingTarget = new MyButton();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Button>(testingTarget, "Should return Button instance.");
+
+ testingTarget.IsEnabled = true;
+ testingTarget.IsSelected = true;
+ testingTarget.Focusable = true;
+
+ try
+ {
+ testingTarget.OnFocusLost();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ButtonOnFocusLost END (OK)");
+ }
+ }
+}
tlog.Debug(tag, $"ButtonGroupItemImageShadow END (OK)");
}
+
+ [Test]
+ [Category("P2")]
+ [Description("ButtonGroup GetItem.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonGroup.GetItem M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ButtonGroupGetItemWithWrongIndex()
+ {
+ tlog.Debug(tag, $"ButtonGroupGetItemWithWrongIndex START");
+
+ using (View view = new View() { Size = new Size(100, 200) })
+ {
+ var testingTarget = new ButtonGroup(view);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ButtonGroup>(testingTarget, "Should return ButtonGroup instance.");
+
+ using (Button bt = new Button() { Size = new Size(20, 30) })
+ {
+ testingTarget.AddItem(bt);
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+ tlog.Debug(tag, "Contains : " + testingTarget.Contains(bt));
+
+ try
+ {
+ testingTarget.GetItem(-1);
+ }
+ catch (Exception e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"ButtonGroupGetItemWithWrongIndex End");
+ Assert.Pass("Caught exception : Passed!");
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("ButtonGroup AddItem.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonGroup.AddItem M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ButtonGroupAddItemPrexisting()
+ {
+ tlog.Debug(tag, $"ButtonGroupAddItemPrexisting START");
+
+ using (View view = new View() { Size = new Size(100, 200) })
+ {
+ var testingTarget = new ButtonGroup(view);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ButtonGroup>(testingTarget, "Should return ButtonGroup instance.");
+
+ using (Button bt = new Button() { Size = new Size(20, 30) })
+ {
+ testingTarget.AddItem(bt);
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+ tlog.Debug(tag, "Contains : " + testingTarget.Contains(bt));
+
+ testingTarget.AddItem(bt);
+ Assert.AreEqual(1, testingTarget.Count, "Should be equal!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ButtonGroupAddItemPrexisting End");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ButtonGroup RemoveItem.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonGroup.RemoveItem M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ButtonGroupRemoveItem()
+ {
+ tlog.Debug(tag, $"ButtonGroupRemoveItem START");
+
+ using (View view = new View() { Size = new Size(100, 200) })
+ {
+ var testingTarget = new ButtonGroup(view);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ButtonGroup>(testingTarget, "Should return ButtonGroup instance.");
+
+ using (Button bt = new Button() { Size = new Size(20, 30) })
+ {
+ testingTarget.AddItem(bt);
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+ tlog.Debug(tag, "Contains : " + testingTarget.Contains(bt));
+
+ testingTarget.RemoveItem(bt);
+ Assert.AreEqual(0, testingTarget.Count, "Should be equal!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ButtonGroupRemoveItem End");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("ButtonGroup RemoveItem.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonGroup.RemoveItem M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ButtonGroupRemoveItemWithNull()
+ {
+ tlog.Debug(tag, $"ButtonGroupRemoveItemWithNull START");
+
+ using (View view = new View() { Size = new Size(100, 200) })
+ {
+ var testingTarget = new ButtonGroup(view);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ButtonGroup>(testingTarget, "Should return ButtonGroup instance.");
+
+ try
+ {
+ Button bt = null;
+ testingTarget.RemoveItem(bt);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ButtonGroupRemoveItemWithNull End");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("ButtonGroup RemoveItem.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonGroup.RemoveItem M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ButtonGroupRemoveItemNotBelongToTheGroup()
+ {
+ tlog.Debug(tag, $"ButtonGroupRemoveItemNotBelongToTheGroup START");
+
+ using (View view = new View() { Size = new Size(100, 200) })
+ {
+ var testingTarget = new ButtonGroup(view);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ButtonGroup>(testingTarget, "Should return ButtonGroup instance.");
+
+ try
+ {
+ using (Button bt = new Button() { Size = new Size(20, 30) })
+ {
+ // bt not added into the group
+ testingTarget.RemoveItem(bt);
+ }
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ButtonGroupRemoveItemNotBelongToTheGroup End");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("ButtonGroup RemoveItem.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonGroup.GetItem M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ButtonGroupRemoveItemWithWrongIndex()
+ {
+ tlog.Debug(tag, $"ButtonGroupRemoveItemWithWrongIndex START");
+
+ using (View view = new View() { Size = new Size(100, 200) })
+ {
+ var testingTarget = new ButtonGroup(view);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ButtonGroup>(testingTarget, "Should return ButtonGroup instance.");
+
+ using (Button bt = new Button() { Size = new Size(20, 30) })
+ {
+ testingTarget.AddItem(bt);
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+ tlog.Debug(tag, "Contains : " + testingTarget.Contains(bt));
+
+ try
+ {
+ testingTarget.RemoveItem(-1);
+ }
+ catch (Exception e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"ButtonGroupRemoveItemWithWrongIndex End");
+ Assert.Pass("Caught exception : Passed!");
+ }
+ }
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ButtonGroup UpdateButton.")]
+ [Property("SPEC", "Tizen.NUI.Components.ButtonGroup.UpdateButton M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ButtonGroupUpdateButton()
+ {
+ tlog.Debug(tag, $"ButtonGroupUpdateButton START");
+
+ using (View view = new View() { Size = new Size(100, 200) , LayoutDirection = ViewLayoutDirectionType.RTL})
+ {
+ var testingTarget = new ButtonGroup(view);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ButtonGroup>(testingTarget, "Should return ButtonGroup instance.");
+
+ Button bt1 = new Button()
+ {
+ Size = new Size(20, 30)
+ };
+ testingTarget.AddItem(bt1);
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+
+ Button bt2 = new Button()
+ {
+ Size = new Size(20, 40)
+ };
+ testingTarget.AddItem(bt2);
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+
+ try
+ {
+ ButtonStyle btStyle = new ButtonStyle()
+ {
+ Size = new Size(100, 80),
+ Text = new TextLabelStyle()
+ {
+ TextColor = new Selector<Color> { All = Color.Yellow },
+ }
+ };
+ testingTarget.UpdateButton(btStyle);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.RemoveAll();
+
+ bt1.Dispose();
+ bt2.Dispose();
+ testingTarget.Dispose();
+ }
+
+ tlog.Debug(tag, $"ButtonGroupUpdateButton End");
+ }
}
}
tlog.Debug(tag, $"CheckBoxGroupCheckAll END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("CheckBoxGroup IsCheckedAll.")]
+ [Property("SPEC", "Tizen.NUI.Components.CheckBoxGroup.IsCheckedAll M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void CheckBoxGroupIsCheckedAll()
+ {
+ tlog.Debug(tag, $"CheckBoxGroupIsCheckedAll START");
+
+ var testingTarget = new CheckBoxGroup();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<CheckBoxGroup>(testingTarget, "Should return CheckBoxGroup instance.");
+
+ CheckBox cb1 = new CheckBox()
+ {
+ Size = new Size(48, 48),
+ IsEnabled = true,
+ IsSelectable = true,
+ IsSelected = true,
+ };
+
+ CheckBox cb2 = new CheckBox()
+ {
+ Size = new Size(48, 48),
+ IsEnabled = true,
+ IsSelectable = true,
+ IsSelected = false,
+ };
+
+ try
+ {
+ testingTarget.Add(cb1);
+ testingTarget.Add(cb2);
+
+ var result = testingTarget.IsCheckedAll();
+ Assert.AreEqual(false, result, "Should be equal!");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"CheckBoxGroupIsCheckedAll END (OK)");
+ }
}
}
tlog.Info(tag, "Destroy() is called!");
}
- //[Test]
- //[Category("P1")]
- //[Description("DatePicker constructor.")]
- //[Property("SPEC", "Tizen.NUI.Components.DatePicker.constructor C")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "CONSTR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void DatePickerConstructor()
- //{
- // tlog.Debug(tag, $"DatePickerConstructor START");
-
- // var testingTarget = new MyDatePicker();
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<DatePicker>(testingTarget, "Should return DatePicker instance.");
-
- // try
- // {
- // testingTarget.OnDispose(DisposeTypes.Explicit);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
-
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"DatePickerConstructor END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("DatePicker OnInitialize.")]
- //[Property("SPEC", "Tizen.NUI.Components.DatePicker.OnInitialize M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void DatePickerOnInitialize()
- //{
- // tlog.Debug(tag, $"DatePickerOnInitialize START");
-
- // var testingTarget = new MyDatePicker();
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<DatePicker>(testingTarget, "Should return DatePicker instance.");
-
- // try
- // {
- // testingTarget.OnInitialize();
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
-
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"DatePickerOnInitialize END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("DatePicker ApplyStyle.")]
- //[Property("SPEC", "Tizen.NUI.Components.DatePicker.ApplyStyle M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void DatePickerApplyStyle()
- //{
- // tlog.Debug(tag, $"DatePickerApplyStyle START");
-
- // var testingTarget = new MyDatePicker();
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<DatePicker>(testingTarget, "Should return DatePicker instance.");
-
- // try
- // {
- // ViewStyle style = new ViewStyle()
- // {
- // Size = new Size(30, 200)
- // };
- // testingTarget.ApplyStyle(style);
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
-
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"DatePickerApplyStyle END (OK)");
- //}
+ [Test]
+ [Category("P1")]
+ [Description("DatePicker constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DatePicker.DatePicker C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DatePickerConstructor()
+ {
+ tlog.Debug(tag, $"DatePickerConstructor START");
+
+ var testingTarget = new DatePicker()
+ {
+ Size = new Size(600, 339),
+ Date = DateTime.Now,
+ };
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DatePicker>(testingTarget, "Should return DatePicker instance.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DatePickerConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DatePicker constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DatePicker.DatePicker M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DatePickerConstructorWithDatePickerStyle()
+ {
+ tlog.Debug(tag, $"DatePickerConstructorWithDatePickerStyle START");
+
+ DatePickerStyle dpStyle = new DatePickerStyle()
+ {
+ Pickers = new PickerStyle()
+ {
+ StartScrollOffset = new Size(10, 10)
+ },
+ CellPadding = new Size2D(20, 20),
+ };
+ var testingTarget = new DatePicker(dpStyle);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DatePicker>(testingTarget, "Should return DatePicker instance.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DatePickerConstructorWithDatePickerStyle END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DatePicker Date.")]
+ [Property("SPEC", "Tizen.NUI.Components.DatePicker.Date A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DatePickerDate()
+ {
+ tlog.Debug(tag, $"DatePickerDate START");
+
+ var testingTarget = new DatePicker();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DatePicker>(testingTarget, "Should return DatePicker instance.");
+
+ testingTarget.Date = DateTime.Now;
+ tlog.Debug(tag, "Date : " + testingTarget.Date);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DatePickerDate END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DatePicker ApplyStyle.")]
+ [Property("SPEC", "Tizen.NUI.Components.DatePicker.ApplyStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DatePickerApplyStyle()
+ {
+ tlog.Debug(tag, $"DatePickerApplyStyle START");
+
+ var testingTarget = new DatePicker()
+ {
+ Size = new Size(600, 339),
+ Date = DateTime.Now,
+ };
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DatePicker>(testingTarget, "Should return DatePicker instance.");
+
+ try
+ {
+ ViewStyle style = new ViewStyle()
+ {
+ Size = new Size(30, 200)
+ };
+ testingTarget.ApplyStyle(style);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DatePickerApplyStyle END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DateChangedEventArgs constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DateChangedEventArgs.DateChangedEventArgs C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DateChangedEventArgsConstructor()
+ {
+ tlog.Debug(tag, $"DateChangedEventArgsConstructor START");
+
+ var testingTarget = new DateChangedEventArgs(new DateTime(2100, 12, 31));
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DateChangedEventArgs>(testingTarget, "Should return DateChangedEventArgs instance.");
+
+ var result = testingTarget.Date;
+ tlog.Debug(tag, "Date : " + result);
+
+ tlog.Debug(tag, $"DateChangedEventArgsConstructor END (OK)");
+ }
}
}
testingTarget.Dispose();
tlog.Debug(tag, $"ScrollBarCreateViewStyle END (OK)");
}
+
+ [Test]
+ [Category("P2")]
+ [Description("ScrollBar SetCurrentValue.")]
+ [Property("SPEC", "Tizen.NUI.Components.ScrollBar.SetCurrentValue M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Obsolete]
+ public void ScrollBarSetCurrentValue()
+ {
+ tlog.Debug(tag, $"ScrollBarSetCurrentValue START");
+
+ var testingTarget = new ScrollBar();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ScrollBar>(testingTarget, "Should return ScrollBar instance.");
+
+ testingTarget.MinValue = 0;
+ tlog.Debug(tag, "MinValue : " + testingTarget.MinValue);
+
+ testingTarget.MaxValue = 100;
+ tlog.Debug(tag, "MaxValue : " + testingTarget.MaxValue);
+
+ testingTarget.Duration = 3;
+ tlog.Debug(tag, "Duration : " + testingTarget.Duration);
+
+ testingTarget.CurrentValue = 30;
+ tlog.Debug(tag, "CurrentValue : " + testingTarget.CurrentValue);
+
+ try
+ {
+ testingTarget.SetCurrentValue(-10, true);
+ }
+ catch (ArgumentOutOfRangeException e)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"ScrollBarSetCurrentValue END (OK)");
+ Assert.Pass("Caught ArgumentOutOfRangeException : Passed!");
+ }
+ }
}
}
testingTarget.VerticalPositionToAnchor = Menu.RelativePosition.Center;
tlog.Debug(tag, "HorizontalPositionToAnchor :" + testingTarget.HorizontalPositionToAnchor);
+ // horizontalPosition == value
+ testingTarget.HorizontalPositionToAnchor = Menu.RelativePosition.Center;
+ tlog.Debug(tag, "HorizontalPositionToAnchor :" + testingTarget.HorizontalPositionToAnchor);
+
List<MenuItem> items = new List<MenuItem>();
MenuItem item = new MenuItem();
items.Add(item);
};
testingTarget.Anchor = anchor2;
+ // anchor == value
+ testingTarget.Anchor = anchor2;
+
+ try
+ {
+ // anchor == null
+ testingTarget.Anchor = null;
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
NUIApplication.GetDefaultWindow().GetDefaultLayer().Remove(testingTarget);
testingTarget.OnDispose(DisposeTypes.Explicit);
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Menu>(testingTarget, "Should return Menu instance.");
+ View scrim = new View()
+ {
+ BackgroundColor = Color.Red,
+ };
+ testingTarget.MyScrim = scrim;
+
View content = new View()
{
Size = new Size2D(100, 30),
};
testingTarget.MyContent = content;
+ // content == value
+ testingTarget.MyContent = content;
+
+ View content2 = new View()
+ {
+ Size = new Size2D(200, 60),
+ BackgroundColor = Color.Yellow
+ };
+ // content != null
+ testingTarget.MyContent = content2;
+
NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(testingTarget);
testingTarget.Size = new Size(50, 80);
testingTarget.Dispose();
tlog.Debug(tag, $"MenuOnRelayout END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("Menu Post.")]
+ [Property("SPEC", "Tizen.NUI.Components.Menu.Post M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void MenuPost()
+ {
+ tlog.Debug(tag, $"MenuPost START");
+
+ var testingTarget = new MyMenu()
+ {
+ Size = new Size(100, 200),
+ BackgroundColor = Color.Green,
+ LayoutDirection = ViewLayoutDirectionType.LTR
+ };
+ Assert.IsNotNull(testingTarget, "Can't create success object Menu");
+ Assert.IsInstanceOf<Menu>(testingTarget, "Costruct Menu Fail");
+
+ View anchor = new View()
+ {
+ Size = new Size(100, 30),
+ BackgroundColor = Color.Cyan
+ };
+ testingTarget.Anchor = anchor;
+
+ View content = new View()
+ {
+ Size = new Size2D(100, 30),
+ };
+ testingTarget.MyContent = content;
+
+ List<MenuItem> items = new List<MenuItem>();
+ MenuItem item = new MenuItem();
+ items.Add(item);
+ testingTarget.Items = items;
+
+ testingTarget.HorizontalPositionToAnchor = Menu.RelativePosition.Start;
+ testingTarget.VerticalPositionToAnchor = Menu.RelativePosition.Start;
+ testingTarget.Post();
+ testingTarget.Dismiss();
+
+ testingTarget.HorizontalPositionToAnchor = Menu.RelativePosition.Center;
+ testingTarget.VerticalPositionToAnchor = Menu.RelativePosition.Center;
+ testingTarget.Post();
+ testingTarget.Dismiss();
+
+ testingTarget.HorizontalPositionToAnchor = Menu.RelativePosition.End;
+ testingTarget.VerticalPositionToAnchor = Menu.RelativePosition.End;
+ testingTarget.Post();
+ testingTarget.Dismiss();
+
+ // LayoutDirection == ViewLayoutDirectionType.LTR
+ testingTarget.LayoutDirection = ViewLayoutDirectionType.RTL;
+
+ testingTarget.HorizontalPositionToAnchor = Menu.RelativePosition.Start;
+ testingTarget.VerticalPositionToAnchor = Menu.RelativePosition.Start;
+ testingTarget.Post();
+ testingTarget.Dismiss();
+
+ testingTarget.HorizontalPositionToAnchor = Menu.RelativePosition.End;
+ testingTarget.VerticalPositionToAnchor = Menu.RelativePosition.End;
+ testingTarget.Post();
+ testingTarget.Dismiss();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"MenuPost END (OK)");
+ }
}
}
[Test]
[Category("P1")]
- [Description("Pagination AccessibilitySetCurrent.")]
- [Property("SPEC", "Tizen.NUI.Components.Pagination.AccessibilitySetCurrent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- public void PaginationAccessibilitySetCurrent()
- {
- tlog.Debug(tag, $"PaginationAccessibilitySetCurrent START");
-
- var testingTarget = new MyPagination();
- Assert.IsNotNull(testingTarget, "null handle");
- Assert.IsInstanceOf<Pagination>(testingTarget, "Should return Pagination instance.");
-
- testingTarget.IndicatorCount = 8;
-
- try
- {
- //Todo: no symbol error, should be fixed.
- //testingTarget.MyAccessibilitySetCurrent(5.0f);
- //testingTarget.MyAccessibilityGetMinimumIncrement();
- }
- catch (Exception e)
- {
- tlog.Debug(tag, e.Message.ToString());
- Assert.Fail("Caught Exception : Failed!");
- }
-
- testingTarget.Dispose();
- tlog.Debug(tag, $"PaginationAccessibilitySetCurrent END (OK)");
- }
-
- [Test]
- [Category("P1")]
[Description("Pagination SelectedIndex.")]
[Property("SPEC", "Tizen.NUI.Components.Pagination.SelectedIndex A")]
[Property("SPEC_URL", "-")]
[Obsolete]
public void RadioHandleControlStateOnTouch()
{
- tlog.Debug(tag, $"RadioButtonOnKey START");
+ tlog.Debug(tag, $"RadioHandleControlStateOnTouch START");
var testingTarget = new MyRadioButton();
Assert.IsNotNull(testingTarget, "null handle");
}
testingTarget.Dispose();
- tlog.Debug(tag, $"RadioButtonOnKey END (OK)");
+ tlog.Debug(tag, $"RadioHandleControlStateOnTouch END (OK)");
}
}
}
{
base.Decelerating(velocity, animation);
}
+
+ public bool MyAccessibilityScrollToChild(View child)
+ {
+ return base.AccessibilityScrollToChild(child);
+ }
}
[SetUp]
testingTarget.Dispose();
tlog.Debug(tag, $"ScrollableBaseDecelerating END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollableBase DecelerationThreshold")]
+ [Property("SPEC", "Tizen.NUI.Components.ScrollableBase.DecelerationThreshold A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollableBaseDecelerationThreshold()
+ {
+ tlog.Debug(tag, $"ScrollableBaseDecelerationThreshold START");
+
+ var testingTarget = new MyScrollableBase()
+ {
+ Size = new Size(100, 2),
+ BackgroundColor = Color.Cyan,
+ ScrollingDirection = ScrollableBase.Direction.Vertical,
+ };
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ScrollableBase>(testingTarget, "Should return ScrollableBase instance.");
+
+ testingTarget.DecelerationThreshold = 0.8f;
+ tlog.Debug(tag, "DecelerationThreshold : " + testingTarget.DecelerationThreshold);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollableBaseDecelerationThreshold END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollableBase ScrollAlphaFunction")]
+ [Property("SPEC", "Tizen.NUI.Components.ScrollableBase.ScrollAlphaFunction A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollableBaseScrollAlphaFunction()
+ {
+ tlog.Debug(tag, $"ScrollableBaseScrollAlphaFunction START");
+
+ var testingTarget = new MyScrollableBase()
+ {
+ Size = new Size(100, 2),
+ BackgroundColor = Color.Cyan,
+ ScrollingDirection = ScrollableBase.Direction.Vertical,
+ };
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ScrollableBase>(testingTarget, "Should return ScrollableBase instance.");
+
+ testingTarget.ScrollAlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseIn);
+ tlog.Debug(tag, "ScrollAlphaFunction : " + testingTarget.ScrollAlphaFunction);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollableBaseScrollAlphaFunction END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ScrollableBase AccessibilityScrollToChild")]
+ [Property("SPEC", "Tizen.NUI.Components.ScrollableBase.AccessibilityScrollToChild M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void ScrollableBaseAccessibilityScrollToChild()
+ {
+ tlog.Debug(tag, $"ScrollableBaseAccessibilityScrollToChild START");
+
+ var testingTarget = new MyScrollableBase()
+ {
+ Size = new Size(2000, 200),
+ BackgroundColor = Color.Cyan,
+ ScrollingDirection = ScrollableBase.Direction.Horizontal,
+ };
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<ScrollableBase>(testingTarget, "Should return ScrollableBase instance.");
+
+ testingTarget.ScrollAlphaFunction = new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseIn);
+ tlog.Debug(tag, "ScrollAlphaFunction : " + testingTarget.ScrollAlphaFunction);
+
+ View[] views = new View[10];
+ for (int i = 0; i < 10; i++)
+ {
+ views[i].Size = new Size(200, 200);
+ testingTarget.Add(views[i]);
+ }
+
+ var result = testingTarget.MyAccessibilityScrollToChild(views[9]);
+ tlog.Debug(tag, "AccessibilityScrollToChild : " + result);
+
+ try
+ {
+ testingTarget.RemoveAllChildren(true);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ScrollableBaseAccessibilityScrollToChild END (OK)");
+ }
}
}
using Tizen.NUI;
using Tizen.NUI.Components;
using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Accessibility;
namespace Tizen.NUI.Components.Devel.Tests
{
private const string tag = "NUITEST";
private string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+ private EventHandler<SliderValueChangedEventArgs> OnValueChangedEvent()
+ {
+ return null;
+ }
+
+ private EventHandler<SliderSlidingFinishedEventArgs> OnSlidingFinishedEvent()
+ {
+ return null;
+ }
+
private EventHandler<SliderValueChangedEventArgs> OnValueChanged()
{
return null;
return null;
}
+ private EventHandler<View.ControlStateChangedEventArgs> OnStateChangedEvent()
+ {
+ return null;
+ }
+
internal class MySlider : Slider
{
public MySlider() : base()
return base.AccessibilityShouldReportZeroChildren();
}
- //Todo: no symbol error, should be fixed.
- //public double OnAccessibilityGetMinimum()
- //{
- // return base.AccessibilityGetMinimum();
- //}
-
- //Todo: no symbol error, should be fixed.
- //public double OnAccessibilityGetCurrent()
- //{
- // return base.AccessibilityGetCurrent();
- //}
-
- //Todo: no symbol error, should be fixed.
- //public double OnAccessibilityGetMaximum()
- //{
- // return base.AccessibilityGetMaximum();
- //}
-
- //Todo: no symbol error, should be fixed.
- //public bool OnAccessibilitySetCurrent(double value)
- //{
- // return base.AccessibilitySetCurrent(value);
- //}
-
- //Todo: no symbol error, should be fixed.
- //public double OnAccessibilityGetMinimumIncrement()
- //{
- // return base.AccessibilityGetMinimumIncrement();
- //}
-
public void MyOnUpdate()
{
base.OnUpdate();
Assert.IsNotNull(testingTarget, "null handle");
Assert.IsInstanceOf<Slider>(testingTarget, "Should return Slider instance.");
- testingTarget.IsEnabled = true;
- tlog.Debug(tag, "IsEnabled : " + testingTarget.IsEnabled);
+ testingTarget.MinValue = 0.0f;
+ testingTarget.MaxValue = 100.0f;
+ testingTarget.CurrentValue = 30.0f;
testingTarget.TrackThickness = 30;
tlog.Debug(tag, "TrackThickness : " + testingTarget.TrackThickness);
[Test]
[Category("P1")]
+ [Description("Slider ValueChangedEvent.")]
+ [Property("SPEC", "Tizen.NUI.Components.Slider.ValueChangedEvent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SliderValueChangedEvent()
+ {
+ tlog.Debug(tag, $"SliderValueChangedEvent START");
+
+ var testingTarget = new Slider()
+ {
+ Direction = Slider.DirectionType.Vertical,
+ };
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Slider>(testingTarget, "Should return Slider instance.");
+
+ testingTarget.ValueChanged += OnValueChangedEvent();
+ testingTarget.ValueChanged -= OnValueChangedEvent();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"SliderValueChangedEvent END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Slider SlidingFinishedEvent.")]
+ [Property("SPEC", "Tizen.NUI.Components.Slider.SlidingFinishedEvent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SliderSlidingFinishedEvent()
+ {
+ tlog.Debug(tag, $"SliderSlidingFinishedEvent START");
+
+ var testingTarget = new Slider()
+ {
+ Direction = Slider.DirectionType.Vertical,
+ };
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Slider>(testingTarget, "Should return Slider instance.");
+
+ testingTarget.SlidingFinished += OnSlidingFinishedEvent();
+ testingTarget.SlidingFinished -= OnSlidingFinishedEvent();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"SliderValueChangedEvent END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("SliderSlidingStartedEventArgs CurrentValue.")]
[Property("SPEC", "Tizen.NUI.Components.Slider.OnKey A")]
[Property("SPEC_URL", "-")]
[Test]
[Category("P1")]
+ [Description("Slider StateChangedEvent.")]
+ [Property("SPEC", "Tizen.NUI.Components.Slider.StateChangedEvent A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SliderStateChangedEvent()
+ {
+ tlog.Debug(tag, $"SliderStateChangedEvent START");
+
+ var testingTarget = new Slider()
+ {
+ Direction = Slider.DirectionType.Vertical,
+ };
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<Slider>(testingTarget, "Should return Slider instance.");
+
+ testingTarget.ControlStateChangedEvent += OnStateChangedEvent();
+ testingTarget.ControlStateChangedEvent -= OnStateChangedEvent();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"SliderStateChangedEvent END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
[Description("Slider ThumbImageUrl.")]
[Property("SPEC", "Tizen.NUI.Components.Slider.ThumbImageUrl A")]
[Property("SPEC_URL", "-")]
[Test]
[Category("P1")]
- [Description("Slider AccessibilityGetMinimum.")]
- [Property("SPEC", "Tizen.NUI.Components.Slider.AccessibilityGetMinimum M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- [Obsolete]
- public void SliderAccessibilityGetMinimum()
- {
- tlog.Debug(tag, $"SliderAccessibilityGetMinimum START");
-
- var testingTarget = new MySlider()
- {
- Direction = Slider.DirectionType.Vertical,
- IsEnabled = true,
- };
- Assert.IsNotNull(testingTarget, "null handle");
- Assert.IsInstanceOf<Slider>(testingTarget, "Should return Slider instance.");
-
- testingTarget.MinValue = 0.0f;
- testingTarget.MaxValue = 100.0f;
- testingTarget.CurrentValue = 30.0f;
-
- //Todo: no symbol error, should be fixed.
- //var result = testingTarget.OnAccessibilityGetMinimum();
- //tlog.Debug(tag, "AccessibilityGetMinimum : " + result);
-
- //Todo: no symbol error, should be fixed.
- //result = testingTarget.OnAccessibilityGetMaximum();
- //tlog.Debug(tag, "AccessibilityGetMaximum : " + result);
-
- //Todo: no symbol error, should be fixed.
- //result = testingTarget.OnAccessibilityGetCurrent();
- //tlog.Debug(tag, "AccessibilityGetCurrent : " + result);
-
- testingTarget.Dispose();
- tlog.Debug(tag, $"SliderAccessibilityGetMinimum END (OK)");
- }
-
- [Test]
- [Category("P1")]
- [Description("Slider AccessibilitySetCurrent.")]
- [Property("SPEC", "Tizen.NUI.Components.Slider.AccessibilitySetCurrent M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- [Obsolete]
- public void SliderAccessibilitySetCurrent()
- {
- tlog.Debug(tag, $"SliderAccessibilitySetCurrent START");
-
- var testingTarget = new MySlider()
- {
- Direction = Slider.DirectionType.Vertical,
- IsEnabled = true,
- };
- Assert.IsNotNull(testingTarget, "null handle");
- Assert.IsInstanceOf<Slider>(testingTarget, "Should return Slider instance.");
-
- testingTarget.MinValue = 0.0f;
- testingTarget.MaxValue = 100.0f;
-
- //Todo: no symbol error, should be fixed.
- //var result = testingTarget.OnAccessibilitySetCurrent(30.0f);
- //tlog.Debug(tag, "AccessibilitySetCurrent : " + result);
-
- testingTarget.Dispose();
- tlog.Debug(tag, $"SliderAccessibilitySetCurrent END (OK)");
- }
-
- [Test]
- [Category("P1")]
- [Description("Slider AccessibilityGetMinimumIncrement.")]
- [Property("SPEC", "Tizen.NUI.Components.Slider.AccessibilityGetMinimumIncrement M")]
- [Property("SPEC_URL", "-")]
- [Property("CRITERIA", "MR")]
- [Property("COVPARAM", "")]
- [Property("AUTHOR", "guowei.wang@samsung.com")]
- [Obsolete]
- public void SliderAccessibilityGetMinimumIncrement()
- {
- tlog.Debug(tag, $"SliderAccessibilityGetMinimumIncrement START");
-
- var testingTarget = new MySlider()
- {
- Direction = Slider.DirectionType.Vertical,
- IsEnabled = true,
- };
- Assert.IsNotNull(testingTarget, "null handle");
- Assert.IsInstanceOf<Slider>(testingTarget, "Should return Slider instance.");
-
- testingTarget.MinValue = 0.0f;
- testingTarget.MaxValue = 100.0f;
-
- //Todo: no symbol error, should be fixed.
- //var result = testingTarget.OnAccessibilityGetMinimumIncrement();
- //tlog.Debug(tag, "AccessibilityGetMinimumIncrement : " + result);
-
- testingTarget.Dispose();
- tlog.Debug(tag, $"SliderAccessibilityGetMinimumIncrement END (OK)");
- }
-
- [Test]
- [Category("P1")]
[Description("Slider OnUpdate.")]
[Property("SPEC", "Tizen.NUI.Components.Slider.OnUpdate M")]
[Property("SPEC_URL", "-")]
tlog.Info(tag, "Destroy() is called!");
}
- //[Test]
- //[Category("P1")]
- //[Description("TimePicker Time.")]
- //[Property("SPEC", "Tizen.NUI.Components.TimePicker.Time A")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "PRW")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void TimePickerTime()
- //{
- // tlog.Debug(tag, $"TimePickerTime START");
-
- // var testingTarget = new MyTimePicker();
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<TimePicker>(testingTarget, "Should return TimePicker instance.");
-
- // tlog.Debug(tag, "Time : " + testingTarget.Time);
-
- // testingTarget.Time = new DateTime(1000);
- // tlog.Debug(tag, "Time : " + testingTarget.Time);
-
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"TimePickerTime END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("TimePicker Is24HourView.")]
- //[Property("SPEC", "Tizen.NUI.Components.TimePicker.Is24HourView A")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "PRW")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void TimePickerIs24HourView()
- //{
- // tlog.Debug(tag, $"TimePickerIs24HourView START");
-
- // var testingTarget = new TimePicker();
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<TimePicker>(testingTarget, "Should return TimePicker instance.");
-
- // testingTarget.Is24HourView = true;
- // tlog.Debug(tag, "Is24HourView : " + testingTarget.Is24HourView);
-
- // testingTarget.Is24HourView = false;
- // tlog.Debug(tag, "Is24HourView : " + testingTarget.Is24HourView);
-
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"TimePickerIs24HourView END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("TimePicker OnInitialize.")]
- //[Property("SPEC", "Tizen.NUI.Components.TimePicker.OnInitialize M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void TimePickerOnInitialize()
- //{
- // tlog.Debug(tag, $"TimePickerOnInitialize START");
-
- // var testingTarget = new MyTimePicker();
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<TimePicker>(testingTarget, "Should return TimePicker instance.");
-
- // try
- // {
- // testingTarget.OnInitialize();
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
-
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"TimePickerOnInitialize END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("TimePicker ApplyStyle.")]
- //[Property("SPEC", "Tizen.NUI.Components.TimePicker.ApplyStyle M")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "MR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void TimePickerApplyStyle()
- //{
- // tlog.Debug(tag, $"TimePickerApplyStyle START");
-
- // var testingTarget = new MyTimePicker();
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<TimePicker>(testingTarget, "Should return TimePicker instance.");
-
- // try
- // {
- // testingTarget.ApplyStyle(new ViewStyle() { Size = new Size(100, 200) });
- // }
- // catch (Exception e)
- // {
- // tlog.Debug(tag, e.Message.ToString());
- // Assert.Fail("Caught Exception : Failed!");
- // }
-
- // testingTarget.Dispose();
- // tlog.Debug(tag, $"TimePickerApplyStyle END (OK)");
- //}
-
- //[Test]
- //[Category("P1")]
- //[Description("TimeChangedEventArgs constructor.")]
- //[Property("SPEC", "Tizen.NUI.Components.TimeChangedEventArgs.TimeChangedEventArgs C")]
- //[Property("SPEC_URL", "-")]
- //[Property("CRITERIA", "CONSTR")]
- //[Property("COVPARAM", "")]
- //[Property("AUTHOR", "guowei.wang@samsung.com")]
- //public void TimeChangedEventArgsConstructor()
- //{
- // tlog.Debug(tag, $"TimeChangedEventArgsConstructor START");
-
- // DateTime dt = new DateTime(1000);
-
- // var testingTarget = new TimeChangedEventArgs(dt);
- // Assert.IsNotNull(testingTarget, "null handle");
- // Assert.IsInstanceOf<TimePicker>(testingTarget, "Should return TimePicker instance.");
-
- // tlog.Debug(tag, "Time : " + testingTarget.Time);
-
- // tlog.Debug(tag, $"TimeChangedEventArgsConstructor END (OK)");
- //}
+ [Test]
+ [Category("P1")]
+ [Description("TimePicker Time.")]
+ [Property("SPEC", "Tizen.NUI.Components.TimePicker.Time A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimePickerTime()
+ {
+ tlog.Debug(tag, $"TimePickerTime START");
+
+ var testingTarget = new TimePicker();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<TimePicker>(testingTarget, "Should return TimePicker instance.");
+
+ tlog.Debug(tag, "Time : " + testingTarget.Time);
+
+ testingTarget.Time = DateTime.Now;
+ tlog.Debug(tag, "Time : " + testingTarget.Time);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"TimePickerTime END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("TimePicker Is24HourView.")]
+ [Property("SPEC", "Tizen.NUI.Components.TimePicker.Is24HourView A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimePickerIs24HourView()
+ {
+ tlog.Debug(tag, $"TimePickerIs24HourView START");
+
+ var testingTarget = new TimePicker();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<TimePicker>(testingTarget, "Should return TimePicker instance.");
+
+ testingTarget.Is24HourView = true;
+ tlog.Debug(tag, "Is24HourView : " + testingTarget.Is24HourView);
+
+ testingTarget.Is24HourView = false;
+ tlog.Debug(tag, "Is24HourView : " + testingTarget.Is24HourView);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"TimePickerIs24HourView END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("TimePicker ApplyStyle.")]
+ [Property("SPEC", "Tizen.NUI.Components.TimePicker.ApplyStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimePickerApplyStyle()
+ {
+ tlog.Debug(tag, $"TimePickerApplyStyle START");
+
+ var testingTarget = new TimePicker();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<TimePicker>(testingTarget, "Should return TimePicker instance.");
+
+ try
+ {
+ testingTarget.ApplyStyle(new ViewStyle() { Size = new Size(100, 200) });
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"TimePickerApplyStyle END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("TimeChangedEventArgs constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.TimeChangedEventArgs.TimeChangedEventArgs C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void TimeChangedEventArgsConstructor()
+ {
+ tlog.Debug(tag, $"TimeChangedEventArgsConstructor START");
+
+ var testingTarget = new TimeChangedEventArgs(DateTime.Now);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<TimePicker>(testingTarget, "Should return TimePicker instance.");
+
+ tlog.Debug(tag, "Time : " + testingTarget.Time);
+
+ tlog.Debug(tag, $"TimeChangedEventArgsConstructor END (OK)");
+ }
}
}
private const string tag = "NUITEST";
private string image_path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
+ internal class LottieSwitchExtensionImpl : LottieSwitchExtension
+ {
+ public LottieSwitchExtensionImpl() : base()
+ { }
+
+ public override ImageView OnCreateIcon(Button button, ImageView icon)
+ {
+ return base.OnCreateIcon(button, icon);
+ }
+
+ public override void OnControlStateChanged(Button button, View.ControlStateChangedEventArgs args)
+ {
+ base.OnControlStateChanged(button, args);
+ }
+ }
+
[SetUp]
public void Init()
{
tlog.Debug(tag, $"LottieSwitchExtensionConstructor END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("LottieSwitchExtension OnCreateIcon.")]
+ [Property("SPEC", "Tizen.NUI.Components.LottieSwitchExtension.OnCreateIcon M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LottieSwitchExtensionOnCreateIcon()
+ {
+ tlog.Debug(tag, $"LottieSwitchExtensionOnCreateIcon START");
+
+ var testingTarget = new LottieSwitchExtensionImpl();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<LottieSwitchExtension>(testingTarget, "Should return LottieSwitchExtension instance.");
+
+ Button button = new Button()
+ {
+ Size = new Size(100, 80),
+ };
+
+ ImageView icon = new ImageView()
+ {
+ ResourceUrl = image_path,
+ };
+
+ var result = testingTarget.OnCreateIcon(button, icon);
+ Assert.IsNotNull(result, "null handle");
+ Assert.IsInstanceOf<ImageView>(result, "Should return LottieSwitchExtension instance.");
+
+ icon.Dispose();
+ button.Dispose();
+ result.Dispose();
+ tlog.Debug(tag, $"LottieSwitchExtensionOnCreateIcon END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LottieSwitchExtension OnControlStateChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.LottieSwitchExtension.OnControlStateChanged M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void LottieSwitchExtensionOnControlStateChanged()
+ {
+ tlog.Debug(tag, $"LottieSwitchExtensionOnControlStateChanged START");
+
+ var testingTarget = new LottieSwitchExtensionImpl();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<LottieSwitchExtension>(testingTarget, "Should return LottieSwitchExtension instance.");
+
+ Button button = new Button()
+ {
+ Size = new Size(100, 80),
+ };
+
+ ControlStateChangedEventArgs args = new ControlStateChangedEventArgs(ControlState.Focused, ControlState.Selected);
+
+ try
+ {
+ testingTarget.OnControlStateChanged(button, args);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ button.Dispose();
+ tlog.Debug(tag, $"LottieSwitchExtensionOnControlStateChanged END (OK)");
+ }
}
}
testingTarget.MyDispose(true);
tlog.Debug(tag, $"SlidingSwitchExtensionOnSelectedChanged END (OK)");
}
+
+ [Test]
+ [Category("P1")]
+ [Description("SlidingSwitchExtension Dispose.")]
+ [Property("SPEC", "Tizen.NUI.Components.SlidingSwitchExtension.Dispose M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SlidingSwitchExtensionDispose()
+ {
+ tlog.Debug(tag, $"SlidingSwitchExtensionDispose START");
+
+ var testingTarget = new SlidingSwitchExtension();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<SlidingSwitchExtension>(testingTarget, "Should return SlidingSwitchExtension instance.");
+
+ try
+ {
+ testingTarget.Dispose();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"SlidingSwitchExtensionDispose END (OK)");
+ }
}
}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Style/DatePickerStyle")]
+ public class DatePickerStyleTest
+ {
+ 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("DatePickerStyle Constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DatePickerStyle.DatePickerStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DatePickerStyleConstructor()
+ {
+ tlog.Debug(tag, $"DatePickerStyleConstructor START");
+
+ DatePickerStyle style = new DatePickerStyle()
+ {
+ CellPadding = new Size2D(100, 200),
+ Pickers = new PickerStyle()
+ {
+ ItemTextLabel = new TextLabelStyle()
+ {
+ EnableAutoScroll = true,
+ Ellipsis = true,
+ }
+ }
+ };
+
+ var testingTarget = new DatePickerStyle(style);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DatePickerStyle>(testingTarget, "Should return DatePickerStyle instance.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DatePickerStyleConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DatePickerStyle CopyFrom.")]
+ [Property("SPEC", "Tizen.NUI.Components.DatePickerStyle.CopyFrom M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DatePickerStyleCopyFrom()
+ {
+ tlog.Debug(tag, $"DatePickerStyleCopyFrom START");
+
+ DatePickerStyle style = new DatePickerStyle()
+ {
+ CellPadding = new Size2D(100, 200),
+ Pickers = new PickerStyle()
+ {
+ ItemTextLabel = new TextLabelStyle()
+ {
+ EnableAutoScroll = true,
+ Ellipsis = true,
+ }
+ }
+ };
+
+ var testingTarget = new DatePickerStyle();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DatePickerStyle>(testingTarget, "Should return DatePickerStyle instance.");
+
+ try
+ {
+ testingTarget.CopyFrom(style);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DatePickerStyleCopyFrom END (OK)");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Style/DefaultGridItemStyle")]
+ public class DefaultGridItemStyleTest
+ {
+ 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("DefaultGridItemStyle Constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItemStyle.DefaultGridItemStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DefaultGridItemStyleConstructor()
+ {
+ tlog.Debug(tag, $"DefaultGridItemStyleConstructor START");
+
+ DefaultGridItemStyle style = new DefaultGridItemStyle()
+ {
+ Label = new TextLabelStyle()
+ {
+ EnableAutoScroll = true,
+ Ellipsis = true,
+ },
+ Image = new ImageViewStyle()
+ {
+ BorderOnly = true,
+ ResourceUrl = new StringSelector
+ {
+ Normal = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png",
+ Selected = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "arrow.png",
+ Disabled = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "button_9patch.png",
+ DisabledSelected = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png",
+ },
+ }
+ };
+
+ var testingTarget = new DefaultGridItemStyle(style);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DefaultGridItemStyle>(testingTarget, "Should return DefaultGridItemStyle instance.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItemStyleConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItemStyle CopyFrom.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItemStyle.CopyFrom M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DefaultGridItemStyleCopyFrom()
+ {
+ tlog.Debug(tag, $"DefaultGridItemStyleCopyFrom START");
+
+ DefaultGridItemStyle style = new DefaultGridItemStyle()
+ {
+ Label = new TextLabelStyle()
+ {
+ EnableAutoScroll = true,
+ Ellipsis = true,
+ },
+ Image = new ImageViewStyle()
+ {
+ BorderOnly = true,
+ ResourceUrl = new StringSelector
+ {
+ Normal = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png",
+ Selected = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "arrow.png",
+ Disabled = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "button_9patch.png",
+ DisabledSelected = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png",
+ },
+ }
+ };
+
+ var testingTarget = new DefaultGridItemStyle();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DefaultGridItemStyle>(testingTarget, "Should return DefaultGridItemStyle instance.");
+
+ try
+ {
+ testingTarget.CopyFrom(style);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItemStyleCopyFrom END (OK)");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Style/DefaultLinearItemStyle")]
+ public class DefaultLinearItemStyleTest
+ {
+ 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("DefaultLinearItemStyle Constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItemStyle.DefaultLinearItemStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DefaultLinearItemStyleConstructor()
+ {
+ tlog.Debug(tag, $"DefaultLinearItemStyleConstructor START");
+
+ DefaultLinearItemStyle style = new DefaultLinearItemStyle()
+ {
+ Label = new TextLabelStyle()
+ {
+ EnableAutoScroll = true,
+ Ellipsis = true,
+ },
+ Icon = new ViewStyle()
+ {
+ Color = new ColorSelector
+ {
+ Normal = Color.Cyan,
+ },
+ }
+ };
+
+ var testingTarget = new DefaultLinearItemStyle(style);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DefaultLinearItemStyle>(testingTarget, "Should return DefaultLinearItemStyle instance.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItemStyleConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItemStyle CopyFrom.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItemStyle.CopyFrom M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DefaultLinearItemStyleCopyFrom()
+ {
+ tlog.Debug(tag, $"DefaultLinearItemStyleCopyFrom START");
+
+ DefaultLinearItemStyle style = new DefaultLinearItemStyle()
+ {
+ Label = new TextLabelStyle()
+ {
+ EnableAutoScroll = true,
+ Ellipsis = true,
+ },
+ Icon = new ViewStyle()
+ {
+ Color = new ColorSelector
+ {
+ Normal = Color.Cyan,
+ },
+ }
+ };
+
+ var testingTarget = new DefaultLinearItemStyle();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DefaultLinearItemStyle>(testingTarget, "Should return DefaultLinearItemStyle instance.");
+
+ try
+ {
+ testingTarget.CopyFrom(style);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItemStyleCopyFrom END (OK)");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Style/DefaultTitleItemStyle")]
+ class DefaultTitleItemStyleTest
+ {
+ 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("DefaultTitleItemStyle Constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultTitleItemStyle.DefaultTitleItemStyle C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DefaultTitleItemStyleConstructor()
+ {
+ tlog.Debug(tag, $"DefaultTitleItemStyleConstructor START");
+
+ DefaultTitleItemStyle style = new DefaultTitleItemStyle()
+ {
+ Label = new TextLabelStyle()
+ {
+ EnableAutoScroll = true,
+ Ellipsis = true,
+ },
+ Icon = new ViewStyle()
+ {
+ Color = new ColorSelector
+ {
+ Normal = Color.Cyan,
+ },
+ }
+ };
+
+ var testingTarget = new DefaultTitleItemStyle(style);
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DefaultTitleItemStyle>(testingTarget, "Should return DefaultTitleItemStyle instance.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultTitleItemStyleConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultTitleItemStyle CopyFrom.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultTitleItemStyle.CopyFrom M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void DefaultTitleItemStyleCopyFrom()
+ {
+ tlog.Debug(tag, $"DefaultTitleItemStyleCopyFrom START");
+
+ DefaultTitleItemStyle style = new DefaultTitleItemStyle()
+ {
+ Label = new TextLabelStyle()
+ {
+ EnableAutoScroll = true,
+ Ellipsis = true,
+ },
+ Icon = new ViewStyle()
+ {
+ Color = new ColorSelector
+ {
+ Normal = Color.Cyan,
+ },
+ }
+ };
+
+ var testingTarget = new DefaultTitleItemStyle();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<DefaultTitleItemStyle>(testingTarget, "Should return DefaultTitleItemStyle instance.");
+
+ try
+ {
+ testingTarget.CopyFrom(style);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultTitleItemStyleCopyFrom END (OK)");
+ }
+ }
+}
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Style/SliderStyle")]
+ public class SliderStyleTest
+ {
+ private const string tag = "NUITEST";
+
+ internal class MySliderStyle : SliderStyle
+ {
+ public MySliderStyle() : base()
+ { }
+
+ public void OnDispose(bool disposing)
+ {
+ base.Dispose(disposing);
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("SliderStyle Dispose.")]
+ [Property("SPEC", "Tizen.NUI.Components.SliderStyle.Dispose M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ public void SliderStyleDispose()
+ {
+ tlog.Debug(tag, $"SliderStyleDispose START");
+
+ var testingTarget = new MySliderStyle();
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<SliderStyle>(testingTarget, "Should return SliderStyle instance.");
+
+ try
+ {
+ testingTarget.OnDispose(true);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"SliderStyleDispose END (OK)");
+ }
+ }
+}
}
[Test]
+ [Category("P2")]
+ [Description("StyleManager RegisterComponentStyle.")]
+ [Property("SPEC", "Tizen.NUI.Components.StyleManager.RegisterComponentStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "guowei.wang@samsung.com")]
+ [Obsolete]
+ public void StyleManagerRegisterComponentStyleWithNullStyle()
+ {
+ tlog.Debug(tag, $"StyleManagerRegisterComponentStyleWithNullStyle START");
+
+ var testingTarget = StyleManager.Instance;
+ Assert.IsNotNull(testingTarget, "null handle");
+ Assert.IsInstanceOf<StyleManager>(testingTarget, "Should return StyleManager instance.");
+
+ try
+ {
+ StyleManager.Instance.RegisterComponentStyle("RadioButton", typeof(RadioButton), null);
+ }
+ catch (ArgumentException e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ tlog.Debug(tag, $"StyleManagerRegisterComponentStyleWithNullStyle END (OK)");
+ Assert.Pass("Caught Exception : Passed!");
+ }
+ }
+
+ [Test]
[Category("P1")]
[Description("ThemeChangeEventArgs CurrentTheme.")]
[Property("SPEC", "Tizen.NUI.Components.ThemeChangeEventArgs.CurrentTheme M")]