--- /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/FlexibleView")]
+ class TSFlexibleView
+ {
+ private const string tag = "NUITEST";
+
+ private FlexibleView GetFlexibleView()
+ {
+ if (null == flexibleView)
+ {
+ flexibleView = UtilityOfFlexView.CreateLinearFlexibleView(scrnSize, LinearLayoutManager.VERTICAL, 131);
+
+ flexibleView.ItemClicked += FlexibleViewItemClicked;
+ flexibleView.ItemClicked -= FlexibleViewItemClicked;
+
+ flexibleView.ItemTouch += FlexibleViewItemTouch;
+ flexibleView.ItemTouch -= FlexibleViewItemTouch;
+
+ flexibleView.StyleChanged += FlexibleViewStyleChanged;
+ flexibleView.StyleChanged -= FlexibleViewStyleChanged;
+
+ flexibleView.Focusable = true;
+
+ flexibleView.KeyEvent += RecyclerView_KeyEvent;
+ flexibleView.FocusGained += FlexibleView_FocusGained;
+ flexibleView.FocusLost += FlexibleView_FocusLost;
+ }
+
+ return flexibleView;
+ }
+
+ private void FlexibleViewStyleChanged(object sender, NUI.StyleManager.StyleChangedEventArgs e)
+ {
+ throw new NotImplementedException();
+ }
+
+ private void FlexibleViewItemTouch(object sender, FlexibleViewItemTouchEventArgs e)
+ {
+ throw new NotImplementedException();
+ }
+
+ private void FlexibleViewItemClicked(object sender, FlexibleViewItemClickedEventArgs e)
+ {
+ throw new NotImplementedException();
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ scrnSize = new Vector2(1920, 1080);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ flexibleView?.Dispose();
+ scrnSize?.Dispose();
+ }
+
+ private FlexibleView flexibleView;
+
+ private Vector2 scrnSize;
+
+ private View onPreFocusChange(object sender, NUI.FocusManager.PreFocusChangeEventArgs e)
+ {
+ return e.CurrentView;
+ }
+
+ private void FlexibleView_FocusLost(object sender, EventArgs e)
+ {
+ View flexibleView = sender as View;
+ flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f);
+ }
+
+ private void FlexibleView_FocusGained(object sender, EventArgs e)
+ {
+ View flexibleView = sender as View;
+ flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.8f);
+ }
+
+ private bool RecyclerView_KeyEvent(object source, View.KeyEventArgs e)
+ {
+ FlexibleView flexibleView = source as FlexibleView;
+ return true;
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleView Padding.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Padding A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewPadding()
+ {
+ tlog.Debug(tag, $"EmptySource START");
+
+ var testingTarget = GetFlexibleView();
+
+ testingTarget.Padding = new Extents(10, 10, 10, 10);
+ Assert.IsNotNull(testingTarget.Padding, "should not be null.");
+
+ tlog.Debug(tag, $"EmptySource END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleView Padding.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.Padding A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewPaddingNull()
+ {
+ tlog.Debug(tag, $"EmptySource START");
+
+ var testingTarget = GetFlexibleView();
+ Assert.IsNotNull(testingTarget.Padding, "should not be null.");
+ tlog.Debug(tag, $"EmptySource END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleView FocusedItemIndex.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.FocusedItemIndex A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewFocusedItemIndex()
+ {
+ tlog.Debug(tag, $"FlexibleViewFocusedItemIndex START");
+
+ var testingTarget = GetFlexibleView();
+ testingTarget.Padding = new Extents(20, 20, 120, 20);
+
+ try
+ {
+ testingTarget.FocusedItemIndex = 1;
+ testingTarget.OnRelayout(scrnSize, null);
+ Assert.AreEqual(testingTarget.FocusedItemIndex, 1, "should be equal.");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"FlexibleViewFocusedItemIndex END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleView SetAdapter.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.SetAdapter M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewSetAdapter()
+ {
+ tlog.Debug(tag, $"FlexibleViewSetAdapter START");
+
+ var testingTarget = GetFlexibleView();
+
+ testingTarget.FocusedItemIndex = 1;
+ testingTarget.OnRelayout(scrnSize, null);
+
+ var adapter = testingTarget.GetAdapter() as UtilityOfFlexView.ListBridge;
+ adapter.InsertData(0);
+ adapter.RemoveData(0);
+ adapter.RemoveData(1);
+ testingTarget.OnRelayout(scrnSize, null);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"FlexibleViewSetAdapter END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleView FindViewHolderForLayoutPosition.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.FindViewHolderForLayoutPosition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewFindViewHolderForLayoutPosition()
+ {
+ tlog.Debug(tag, $"FlexibleViewFindViewHolderForLayoutPosition START");
+
+ EventHandler onRelayout = (s, e) => {};
+
+ var testingTarget = GetFlexibleView();
+ testingTarget.Relayout += onRelayout;
+
+ testingTarget.OnRelayout(scrnSize, null);
+
+ try
+ {
+ testingTarget.FindViewHolderForLayoutPosition(0);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ Window.Instance.Remove(testingTarget);
+ testingTarget.Relayout -= onRelayout;
+
+ tlog.Debug(tag, $"FlexibleViewFindViewHolderForLayoutPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleView FindViewHolderForAdapterPosition.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.FindViewHolderForAdapterPosition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewFindViewHolderForAdapterPosition()
+ {
+ tlog.Debug(tag, $"FlexibleViewFindViewHolderForAdapterPosition START");
+
+ var testingTarget = GetFlexibleView();
+
+ Window.Instance.Add(testingTarget);
+
+ try
+ {
+ testingTarget.FindViewHolderForLayoutPosition(0);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ if (testingTarget != null)
+ {
+ Window.Instance.Remove(testingTarget);
+ }
+ tlog.Debug(tag, $"FlexibleViewFindViewHolderForAdapterPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleView ScrollToPositionWithOffset.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.ScrollToPositionWithOffset M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewScrollToPositionWithOffset()
+ {
+ tlog.Debug(tag, $"FlexibleViewScrollToPositionWithOffset START");
+
+ var testingTarget = GetFlexibleView();
+
+ Window.Instance.Add(testingTarget);
+
+ try
+ {
+ testingTarget.ScrollToPositionWithOffset(10, 10);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ if (testingTarget != null)
+ {
+ Window.Instance.Remove(testingTarget);
+ }
+ tlog.Debug(tag, $"FlexibleViewScrollToPositionWithOffset END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleView MoveFocus.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.MoveFocus M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewMoveFocus()
+ {
+ tlog.Debug(tag, $"FlexibleViewMoveFocus START");
+
+ var testingTarget = GetFlexibleView();
+
+ Window.Instance.Add(testingTarget);
+
+ try
+ {
+ testingTarget.MoveFocus(FlexibleViewLayoutManager.Direction.Down);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ if (testingTarget != null)
+ {
+ Window.Instance.Remove(testingTarget);
+ }
+ tlog.Debug(tag, $"FlexibleViewMoveFocus END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("FlexibleView MoveFocus.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.MoveFocus M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewMoveFocusUp()
+ {
+ tlog.Debug(tag, $"FlexibleViewMoveFocusUp START");
+ var testingTarget = GetFlexibleView();
+
+ Window.Instance.Add(testingTarget);
+
+ try
+ {
+ testingTarget.MoveFocus(FlexibleViewLayoutManager.Direction.Up);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ if (testingTarget != null)
+ {
+ Window.Instance.Remove(testingTarget);
+ }
+ tlog.Debug(tag, $"FlexibleViewMoveFocusUp END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("FlexibleView MoveFocus.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.MoveFocus M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewMoveFocusLeft()
+ {
+ tlog.Debug(tag, $"FlexibleViewMoveFocusLeft START");
+
+ var testingTarget = GetFlexibleView();
+
+ try
+ {
+ testingTarget.MoveFocus(FlexibleViewLayoutManager.Direction.Left);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ if (testingTarget != null)
+ {
+ Window.Instance.Remove(testingTarget);
+ }
+ tlog.Debug(tag, $"FlexibleViewMoveFocusLeft END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("FlexibleView MoveFocus.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.MoveFocus M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewMoveFocusRight()
+ {
+ tlog.Debug(tag, $"FlexibleViewMoveFocusRight START");
+
+ var testingTarget = GetFlexibleView();
+
+ Window.Instance.Add(testingTarget);
+
+ try
+ {
+ testingTarget.MoveFocus(FlexibleViewLayoutManager.Direction.Right);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ if (testingTarget != null)
+ {
+ Window.Instance.Remove(testingTarget);
+ }
+ tlog.Debug(tag, $"FlexibleViewMoveFocusRight END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleView AttachScrollBar.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.AttachScrollBar M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ [Obsolete]
+ public void FlexibleViewAttachScrollBar()
+ {
+ tlog.Debug(tag, $"FlexibleViewAttachScrollBar START");
+
+ var testingTarget = GetFlexibleView();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<FlexibleView>(testingTarget, "should be an instance of testing target class!");
+
+ var scrollBar = new ScrollBar();
+ scrollBar.Direction = ScrollBar.DirectionType.Vertical;
+ scrollBar.Position = new Position(394, 2);
+ scrollBar.WidthSpecification = 4;
+ scrollBar.HeightSpecification = 446;
+ scrollBar.TrackColor = Color.Green;
+ scrollBar.ThumbSize = new Size(4, 30);
+ scrollBar.ThumbColor = Color.Yellow;
+
+ try
+ {
+ testingTarget.AttachScrollBar(null);
+ testingTarget.AttachScrollBar(scrollBar);
+ testingTarget.FocusedItemIndex = 10;
+ testingTarget.OnRelayout(scrnSize, null);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ scrollBar.Dispose();
+ tlog.Debug(tag, $"FlexibleViewAttachScrollBar END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleView DetachScrollBar.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleView.DetachScrollBar M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewDetachScrollBar()
+ {
+ tlog.Debug(tag, $"FlexibleViewDetachScrollBar START");
+
+ var testingTarget = GetFlexibleView();
+
+ var scrollBar = new ScrollBar();
+ scrollBar.Direction = ScrollBar.DirectionType.Vertical;
+ scrollBar.Position = new Position(394, 2);
+ scrollBar.WidthSpecification = 4;
+ scrollBar.HeightSpecification = 446;
+ scrollBar.TrackColor = Color.Green;
+ scrollBar.ThumbSize = new Size(4, 30);
+ scrollBar.ThumbColor = Color.Yellow;
+
+ try
+ {
+ testingTarget.AttachScrollBar(scrollBar);
+ testingTarget.DetachScrollBar();
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ scrollBar.Dispose();
+ tlog.Debug(tag, $"FlexibleViewDetachScrollBar 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/FlexibleView")]
+ class TSFlexibleViewLayoutManager
+ {
+ private const string tag = "NUITEST";
+
+ public class ListItemData
+ {
+ private string str;
+
+ public ListItemData(int i)
+ {
+ str = "Text" + i.ToString();
+ }
+
+ public string TextString
+ {
+ get
+ {
+ return str;
+ }
+ }
+ }
+
+ public class ListItemView : View
+ {
+ private TextLabel mText;
+
+ public ListItemView()
+ {
+ mText = new TextLabel();
+ mText.WidthResizePolicy = ResizePolicyType.FillToParent;
+ mText.HeightResizePolicy = ResizePolicyType.FillToParent;
+ mText.PointSize = 22;
+ mText.HorizontalAlignment = HorizontalAlignment.Center;
+ mText.VerticalAlignment = VerticalAlignment.Center;
+ Add(mText);
+ }
+
+ public string MainText
+ {
+ get
+ {
+ return mText.Text;
+ }
+ set
+ {
+ mText.Text = value;
+ }
+ }
+ }
+
+ public class ListBridge : FlexibleViewAdapter
+ {
+ private List<ListItemData> mDatas;
+
+ public ListBridge(List<ListItemData> datas)
+ {
+ mDatas = datas;
+ }
+
+ public void InsertData(int position)
+ {
+ mDatas.Insert(position, new ListItemData(1000 + position));
+ NotifyItemInserted(position);
+ }
+
+ public void RemoveData(int position)
+ {
+ mDatas.RemoveAt(position);
+ NotifyItemRemoved(position);
+ }
+
+ public override FlexibleViewViewHolder OnCreateViewHolder(int viewType)
+ {
+ FlexibleViewViewHolder viewHolder = new FlexibleViewViewHolder(new ListItemView());
+ //Console.WriteLine($"OnCreateViewHolder... viewType: {viewType} viewID: {viewHolder.ItemView.ID}");
+
+ return viewHolder;
+ }
+
+ public override void OnBindViewHolder(FlexibleViewViewHolder holder, int position)
+ {
+ //Console.WriteLine($"OnBindItemView... position: {position}");
+ ListItemData listItemData = mDatas[position];
+
+ ListItemView listItemView = holder.ItemView as ListItemView;
+ listItemView.Name = "Item" + position;
+ //Random rd = new Random();
+ listItemView.SizeWidth = 150;
+ listItemView.SizeHeight = 60;
+ if (listItemView != null)
+ {
+ listItemView.MainText = String.Format("{0:D2}", position) + " : " + listItemData.TextString;
+ }
+ listItemView.Margin = new Extents(2, 2, 2, 2);
+ if (position % 2 == 0)
+ listItemView.BackgroundColor = Color.Cyan;
+ else
+ listItemView.BackgroundColor = Color.Yellow;
+ }
+
+ public override void OnDestroyViewHolder(FlexibleViewViewHolder holder)
+ {
+ //Console.WriteLine($"OnDestroyViewHolder... viewID: {holder.ItemView?.ID}");
+ if (holder.ItemView != null)
+ {
+ holder.ItemView.Dispose();
+ }
+ }
+
+ public override int GetItemCount()
+ {
+ return mDatas.Count;
+ }
+
+ public override void OnFocusChange(FlexibleView flexibleView, int previousFocus, int currentFocus)
+ {
+ FlexibleViewViewHolder previousFocusView = flexibleView.FindViewHolderForAdapterPosition(previousFocus);
+ if (previousFocusView != null)
+ {
+ //Console.WriteLine($"previousFocus {previousFocus.AdapterPosition}");
+ if (previousFocusView.AdapterPosition % 2 == 0)
+ previousFocusView.ItemView.BackgroundColor = Color.Cyan;
+ else
+ previousFocusView.ItemView.BackgroundColor = Color.Yellow;
+ //previousFocus.SizeWidth = 150;
+ //previousFocus.SizeHeight = 60;
+ //NotifyItemChanged(previousFocus.AdapterPosition);
+ }
+ FlexibleViewViewHolder currentFocusView = flexibleView.FindViewHolderForAdapterPosition(currentFocus);
+ if (currentFocusView != null)
+ {
+ //Console.WriteLine($"currentFocus {currentFocus.AdapterPosition}");
+ currentFocusView.ItemView.BackgroundColor = Color.Magenta;
+ //currentFocus.SizeWidth = 200;
+ //currentFocus.SizeHeight = 100;
+ //NotifyItemChanged(currentFocus.AdapterPosition);
+ }
+ }
+
+ public override void OnViewAttachedToWindow(FlexibleViewViewHolder holder)
+ {
+ //Console.WriteLine($"+Attached: {holder.AdapterPosition}");
+ }
+
+ public override void OnViewDetachedFromWindow(FlexibleViewViewHolder holder)
+ {
+ //Console.WriteLine($" --Detached: {holder.AdapterPosition}");
+ }
+ }
+
+ private FlexibleView GetVerticalFlexibleView()
+ {
+ if (null == verticalFlexibleView)
+ {
+ verticalFlexibleView = new FlexibleView();
+
+ Assert.IsNotNull(verticalFlexibleView, "should be not null");
+ Assert.IsInstanceOf<FlexibleView>(verticalFlexibleView, "should be an instance of testing target class!");
+
+ verticalFlexibleView = new FlexibleView();
+ verticalFlexibleView.OnRelayout(scrnSize, null);
+
+ verticalFlexibleView.Name = "RecyclerView1";
+ verticalFlexibleView.WidthSpecification = 400;
+ verticalFlexibleView.HeightSpecification = 450;
+ verticalFlexibleView.Padding = new Extents(10, 10, 10, 10);
+ verticalFlexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f);
+
+ List<ListItemData> dataList = new List<ListItemData>();
+ for (int i = 0; i < 8; ++i)
+ {
+ dataList.Add(new ListItemData(i));
+ }
+ adapter = new ListBridge(dataList);
+ verticalFlexibleView.SetAdapter(adapter);
+ verticalFlexibleView.OnRelayout(scrnSize, null);
+
+ verticalLayoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL);
+ verticalFlexibleView.SetLayoutManager(verticalLayoutManager);
+ verticalFlexibleView.OnRelayout(scrnSize, null);
+
+ verticalFlexibleView.Focusable = true;
+
+ verticalFlexibleView.KeyEvent += RecyclerView_KeyEvent;
+ verticalFlexibleView.FocusGained += FlexibleView_FocusGained;
+ verticalFlexibleView.FocusLost += FlexibleView_FocusLost;
+ }
+
+ return verticalFlexibleView;
+ }
+
+ private FlexibleView GetHorizontalFlexibleView()
+ {
+ if (null == horizontalFlexibleView)
+ {
+ horizontalFlexibleView = new FlexibleView();
+
+ Assert.IsNotNull(horizontalFlexibleView, "should be not null");
+ Assert.IsInstanceOf<FlexibleView>(horizontalFlexibleView, "should be an instance of testing target class!");
+
+ horizontalFlexibleView = new FlexibleView();
+ horizontalFlexibleView.OnRelayout(scrnSize, null);
+
+ horizontalFlexibleView.Name = "RecyclerView1";
+ horizontalFlexibleView.WidthSpecification = 400;
+ horizontalFlexibleView.HeightSpecification = 450;
+ horizontalFlexibleView.Padding = new Extents(10, 10, 10, 10);
+ horizontalFlexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f);
+
+ List<ListItemData> dataList = new List<ListItemData>();
+ for (int i = 0; i < 4; ++i)
+ {
+ dataList.Add(new ListItemData(i));
+ }
+ adapter = new ListBridge(dataList);
+ horizontalFlexibleView.SetAdapter(adapter);
+ horizontalFlexibleView.OnRelayout(scrnSize, null);
+
+ horizontalLayoutManager = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL);
+ horizontalFlexibleView.SetLayoutManager(horizontalLayoutManager);
+ horizontalFlexibleView.OnRelayout(scrnSize, null);
+
+ horizontalFlexibleView.Focusable = true;
+
+ horizontalFlexibleView.KeyEvent += RecyclerView_KeyEvent;
+ horizontalFlexibleView.FocusGained += FlexibleView_FocusGained;
+ horizontalFlexibleView.FocusLost += FlexibleView_FocusLost;
+ }
+
+ return horizontalFlexibleView;
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ scrnSize = new Vector2(1920, 1080);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ verticalFlexibleView?.Dispose();
+ horizontalFlexibleView?.Dispose();
+ scrnSize?.Dispose();
+ verticalLayoutManager?.Dispose();
+ horizontalLayoutManager?.Dispose();
+ }
+
+ private FlexibleView verticalFlexibleView;
+ private FlexibleView horizontalFlexibleView;
+ private ListBridge adapter;
+ private LinearLayoutManager verticalLayoutManager;
+ private LinearLayoutManager horizontalLayoutManager;
+
+ private Vector2 scrnSize;
+
+ private View onPreFocusChange(object sender, NUI.FocusManager.PreFocusChangeEventArgs e)
+ {
+ return e.CurrentView;
+ }
+
+ private void FlexibleView_FocusLost(object sender, EventArgs e)
+ {
+ View flexibleView = sender as View;
+ flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f);
+ }
+
+ private void FlexibleView_FocusGained(object sender, EventArgs e)
+ {
+ View flexibleView = sender as View;
+ flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.8f);
+ }
+
+ private bool RecyclerView_KeyEvent(object source, View.KeyEventArgs e)
+ {
+ FlexibleView flexibleView = source as FlexibleView;
+ return true;
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleViewLayoutManager OffsetChildrenHorizontal.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.OffsetChildrenHorizontal A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewLayoutManagerOffsetChildrenHorizontal()
+ {
+ tlog.Debug(tag, $"FlexibleViewLayoutManagerOffsetChildrenHorizontal START");
+
+ var testingTarget = GetHorizontalFlexibleView();
+ testingTarget.Padding = new Extents(20, 20, 120, 20);
+
+ try
+ {
+ horizontalLayoutManager.OffsetChildrenHorizontal(0, true);
+ horizontalLayoutManager.OffsetChildrenHorizontal(30, true);
+ horizontalLayoutManager.OffsetChildrenHorizontal(30, false);
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"FlexibleViewLayoutManagerOffsetChildrenHorizontal END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleViewLayoutManager OffsetChildrenVertical.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleViewLayoutManager.OffsetChildrenVertical A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewLayoutManagerOffsetChildrenVertical()
+ {
+ tlog.Debug(tag, $"FlexibleViewLayoutManagerOffsetChildrenVertical START");
+
+ var testingTarget = GetVerticalFlexibleView();
+ testingTarget.Padding = new Extents(20, 20, 120, 20);
+
+ try
+ {
+ verticalLayoutManager.OffsetChildrenVertical(0, true);
+ verticalLayoutManager.OffsetChildrenVertical(30, true);
+ verticalLayoutManager.OffsetChildrenVertical(30, false);
+
+ verticalLayoutManager.StopScroll(true);
+ verticalFlexibleView = null;
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ tlog.Debug(tag, $"FlexibleViewLayoutManagerOffsetChildrenVertical END (OK)");
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Controls/FlexibleView/LinearLayoutManager")]
+ class TSFlexibleViewViewHolder
+ {
+ 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("FlexibleViewViewHolder constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleViewViewHolder C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewViewHolderConstructor()
+ {
+ tlog.Debug(tag, $"FlexibleViewViewHolderConstructor START");
+
+ var v = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ var testingTarget = new FlexibleViewViewHolder(v);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<FlexibleViewViewHolder>(testingTarget, "should be an instance of testing target class!");
+
+ tlog.Debug(tag, $"FlexibleViewViewHolderConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleViewViewHolder ItemView.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleViewViewHolder.ItemView A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewViewHolderItemView()
+ {
+ tlog.Debug(tag, $"FlexibleViewViewHolderItemView START");
+
+ var v = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ var testingTarget = new FlexibleViewViewHolder(v);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<FlexibleViewViewHolder>(testingTarget, "should be an instance of testing target class!");
+ Assert.IsNotNull(testingTarget.ItemView, "should not be null.");
+
+ tlog.Debug(tag, $"FlexibleViewViewHolderItemView END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleViewViewHolder Left.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleViewViewHolder.Left A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewViewHolderLeft()
+ {
+ tlog.Debug(tag, $"FlexibleViewViewHolderLeft START");
+
+ var v = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ var testingTarget = new FlexibleViewViewHolder(v);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<FlexibleViewViewHolder>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.Left, 0, "should be equal.");
+
+ tlog.Debug(tag, $"FlexibleViewViewHolderLeft END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleViewViewHolder Right.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleViewViewHolder.Right A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewViewHolderRight()
+ {
+ tlog.Debug(tag, $"FlexibleViewViewHolderRight START");
+
+ var v = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ var testingTarget = new FlexibleViewViewHolder(v);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<FlexibleViewViewHolder>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.Right, 100, "should be equal.");
+
+ tlog.Debug(tag, $"FlexibleViewViewHolderRight END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleViewViewHolder Top.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleViewViewHolder.Top A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewViewHolderTop()
+ {
+ tlog.Debug(tag, $"FlexibleViewViewHolderTop START");
+
+ var v = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ var testingTarget = new FlexibleViewViewHolder(v);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<FlexibleViewViewHolder>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.Top, 0, "should be equal.");
+
+ tlog.Debug(tag, $"FlexibleViewViewHolderTop END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("FlexibleViewViewHolder Bottom.")]
+ [Property("SPEC", "Tizen.NUI.Components.FlexibleViewViewHolder.Bottom A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void FlexibleViewViewHolderBottom()
+ {
+ tlog.Debug(tag, $"FlexibleViewViewHolderBottom START");
+
+ var v = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ var testingTarget = new FlexibleViewViewHolder(v);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<FlexibleViewViewHolder>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.Bottom, 100, "should be equal.");
+
+ tlog.Debug(tag, $"FlexibleViewViewHolderBottom END (OK)");
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Controls/FlexibleView/LinearLayoutManager")]
+ class TSGridLayoutManager
+ {
+ private const string tag = "NUITEST";
+ private Vector2 scrnSize;
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ scrnSize = new Vector2(1920, 1080);
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ scrnSize?.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayoutManager constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayoutManager C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void GridLayoutManagerConstructor()
+ {
+ tlog.Debug(tag, $"GridLayoutManagerConstructor START");
+
+ var testingTarget = new GridLayoutManager(2, GridLayoutManager.HORIZONTAL);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<GridLayoutManager>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"GridLayoutManagerConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayoutManager EnsureAnchorReady.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayoutManager EnsureAnchorReady")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayoutManagerEnsureAnchorReady()
+ {
+ tlog.Debug(tag, $"GridLayoutManagerEnsureAnchorReady START");
+
+ var flexView = UtilityOfFlexView.CreateGridFlexibleView(scrnSize, GridLayoutManager.HORIZONTAL, 20);
+
+ var layout = flexView.GetLayoutManager() as GridLayoutManager;
+ var recycler = flexView.GetRecycler();
+ var t = new Components.LinearLayoutManager.AnchorInfo()
+ {
+ Position = 6,
+ };
+ layout.EnsureAnchorReady(recycler, t, GridLayoutManager.LayoutState.LAYOUT_START);
+
+ t.Position = 5;
+ layout.EnsureAnchorReady(recycler, t, GridLayoutManager.LayoutState.ITEM_DIRECTION_TAIL);
+
+ flexView.Dispose();
+ tlog.Debug(tag, $"GridLayoutManagerEnsureAnchorReady END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayoutManager GetNextPosition.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayoutManager GetNextPosition")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayoutManagerGetNextPosition()
+ {
+ tlog.Debug(tag, $"GridLayoutManagerGetNextPosition START");
+
+ var flexView = UtilityOfFlexView.CreateGridFlexibleView(scrnSize, GridLayoutManager.HORIZONTAL, 20);
+
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Left);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Up);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Right);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Down);
+
+ flexView.FocusedItemIndex = 10;
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Up);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Down);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Left);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Right);
+
+ flexView.Dispose();
+
+ flexView = UtilityOfFlexView.CreateGridFlexibleView(scrnSize, GridLayoutManager.VERTICAL, 20);
+
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Left);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Up);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Right);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Down);
+
+ flexView.FocusedItemIndex = 10;
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Up);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Down);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Left);
+ flexView.MoveFocus(FlexibleViewLayoutManager.Direction.Right);
+
+ flexView.Dispose();
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Controls/FlexibleView/LinearLayoutManager")]
+ class TSLinearLayoutManager
+ {
+ private const string tag = "NUITEST";
+
+ private Vector2 scrnSize;
+
+ [SetUp]
+ public void Init()
+ {
+ scrnSize = new Vector2(1920, 1080);
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ scrnSize?.Dispose();
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayoutManager constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void LinearLayoutManagerConstructor()
+ {
+ tlog.Debug(tag, $"LinearLayoutManagerConstructor START");
+
+ var testingTarget = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearLayoutManager>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearLayoutManagerConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayoutManager FirstVisibleItemPosition.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.FirstVisibleItemPosition A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void LinearLayoutManagerFirstVisibleItemPosition()
+ {
+ tlog.Debug(tag, $"LinearLayoutManagerFirstVisibleItemPosition START");
+
+ var testingTarget = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearLayoutManager>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.FirstVisibleItemPosition, -1, "should be equal.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearLayoutManagerFirstVisibleItemPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayoutManager FirstCompleteVisibleItemPosition.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.FirstCompleteVisibleItemPosition A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void LinearLayoutManagerFirstCompleteVisibleItemPosition()
+ {
+ tlog.Debug(tag, $"LinearLayoutManagerFirstCompleteVisibleItemPosition START");
+
+ var testingTarget = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearLayoutManager>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.FirstCompleteVisibleItemPosition, -1, "should be equal to 0.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearLayoutManagerFirstCompleteVisibleItemPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayoutManager LastVisibleItemPosition.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.LastVisibleItemPosition A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void LinearLayoutManagerLastVisibleItemPosition()
+ {
+ tlog.Debug(tag, $"LinearLayoutManagerLastVisibleItemPosition START");
+
+ var testingTarget = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearLayoutManager>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.LastVisibleItemPosition, -1, "should be equal to 0.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearLayoutManagerLastVisibleItemPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayoutManager LastCompleteVisibleItemPosition.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.LastCompleteVisibleItemPosition A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void LinearLayoutManagerLastCompleteVisibleItemPosition()
+ {
+ tlog.Debug(tag, $"LinearLayoutManagerLastCompleteVisibleItemPosition START");
+
+ var testingTarget = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearLayoutManager>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.LastCompleteVisibleItemPosition, -1, "should be equal to 0.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearLayoutManagerLastCompleteVisibleItemPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayoutManager CanScrollHorizontally.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.CanScrollHorizontally M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void LinearLayoutManagerCanScrollHorizontally()
+ {
+ tlog.Debug(tag, $"LinearLayoutManagerCanScrollHorizontally START");
+
+ var testingTarget = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearLayoutManager>(testingTarget, "should be an instance of testing target class!");
+ Assert.IsTrue(testingTarget.CanScrollHorizontally(), "should be true.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearLayoutManagerCanScrollHorizontally END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayoutManager CanScrollVertically.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.CanScrollVertically M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void LinearLayoutManagerCanScrollVertically()
+ {
+ tlog.Debug(tag, $"LinearLayoutManagerCanScrollVertically START");
+
+ var testingTarget = new LinearLayoutManager(LinearLayoutManager.HORIZONTAL);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<LinearLayoutManager>(testingTarget, "should be an instance of testing target class!");
+ Assert.IsFalse(testingTarget.CanScrollVertically(), "should be false.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearLayoutManagerCanScrollVertically END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayoutManager OnFocusSearchFailed.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.OnFocusSearchFailed M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayoutManagerOnFocusSearchFailed()
+ {
+ tlog.Debug(tag, $"LinearLayoutManagerCanScrollVertically START");
+
+ var testingTarget = UtilityOfFlexView.CreateLinearFlexibleView(scrnSize, LinearLayoutManager.VERTICAL, 8);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<FlexibleView>(testingTarget, "should be an instance of testing target class!");
+
+ var layout = testingTarget.GetLayoutManager();
+ var recycler = testingTarget.GetRecycler();
+ layout.OnFocusSearchFailed(null, FlexibleViewLayoutManager.Direction.Up, recycler);
+ layout.OnFocusSearchFailed(null, FlexibleViewLayoutManager.Direction.Down, recycler);
+ layout.OnFocusSearchFailed(null, FlexibleViewLayoutManager.Direction.Left, recycler);
+ layout.OnFocusSearchFailed(null, FlexibleViewLayoutManager.Direction.Right, recycler);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"LinearLayoutManagerCanScrollVertically END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayoutManager ScrollHorizontallyBy.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.ScrollHorizontallyBy M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayoutManagerScrollHorizontallyBy()
+ {
+ tlog.Debug(tag, $"LinearLayoutManagerScrollHorizontallyBy START");
+
+ var testingTarget = UtilityOfFlexView.CreateLinearFlexibleView(scrnSize, LinearLayoutManager.VERTICAL, 8);
+
+ var layout = testingTarget.GetLayoutManager();
+ var recycler = testingTarget.GetRecycler();
+
+ layout.ScrollHorizontallyBy(20, recycler, false);
+ testingTarget.Dispose();
+
+ testingTarget = UtilityOfFlexView.CreateLinearFlexibleView(scrnSize, LinearLayoutManager.HORIZONTAL, 4);
+
+ layout = testingTarget.GetLayoutManager();
+ recycler = testingTarget.GetRecycler();
+
+ layout.ScrollHorizontallyBy(20, recycler, false);
+ layout.ScrollHorizontallyBy(20, recycler, true);
+ layout.ScrollHorizontallyBy(-20, recycler, false);
+ layout.ScrollHorizontallyBy(-20, recycler, true);
+
+ testingTarget.Dispose();
+
+ tlog.Debug(tag, $"LinearLayoutManagerScrollHorizontallyBy END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayoutManager ScrollVerticallyBy.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayoutManager.ScrollVerticallyBy M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayoutManagerScrollVerticallyBy()
+ {
+ tlog.Debug(tag, $"LinearLayoutManagerScrollVerticallyBy START");
+
+ var testingTarget = UtilityOfFlexView.CreateLinearFlexibleView(scrnSize, LinearLayoutManager.HORIZONTAL, 4);
+
+ var layout = testingTarget.GetLayoutManager();
+ var recycler = testingTarget.GetRecycler();
+
+ layout.ScrollHorizontallyBy(20, recycler, false);
+ testingTarget.Dispose();
+
+ testingTarget = UtilityOfFlexView.CreateLinearFlexibleView(scrnSize, LinearLayoutManager.VERTICAL, 8);
+
+ layout = testingTarget.GetLayoutManager();
+ recycler = testingTarget.GetRecycler();
+
+ layout.ScrollVerticallyBy(20, recycler, false);
+ layout.ScrollVerticallyBy(20, recycler, true);
+ layout.ScrollVerticallyBy(-20, recycler, false);
+ layout.ScrollVerticallyBy(-20, recycler, true);
+
+ testingTarget.Dispose();
+
+ tlog.Debug(tag, $"LinearLayoutManagerScrollVerticallyBy 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;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ public static class UtilityOfFlexView
+ {
+ public class ListItemData
+ {
+ private string str;
+
+ public ListItemData(int i)
+ {
+ str = "Text" + i.ToString();
+ }
+
+ public string TextString
+ {
+ get
+ {
+ return str;
+ }
+ }
+ }
+
+ public class ListItemView : View
+ {
+ private TextLabel mText;
+
+ public ListItemView()
+ {
+ mText = new TextLabel();
+ mText.WidthResizePolicy = ResizePolicyType.FillToParent;
+ mText.HeightResizePolicy = ResizePolicyType.FillToParent;
+ mText.PointSize = 22;
+ mText.HorizontalAlignment = HorizontalAlignment.Center;
+ mText.VerticalAlignment = VerticalAlignment.Center;
+ Add(mText);
+ }
+
+ public string MainText
+ {
+ get
+ {
+ return mText.Text;
+ }
+ set
+ {
+ mText.Text = value;
+ }
+ }
+ }
+
+ public class ListBridge : FlexibleViewAdapter
+ {
+ private List<ListItemData> mDatas;
+
+ public ListBridge(List<ListItemData> datas)
+ {
+ mDatas = datas;
+ }
+
+ public void InsertData(int position)
+ {
+ mDatas.Insert(position, new ListItemData(1000 + position));
+ NotifyItemInserted(position);
+ }
+
+ public void RemoveData(int position)
+ {
+ mDatas.RemoveAt(position);
+ NotifyItemRemoved(position);
+ }
+
+ public override FlexibleViewViewHolder OnCreateViewHolder(int viewType)
+ {
+ FlexibleViewViewHolder viewHolder = new FlexibleViewViewHolder(new ListItemView());
+ //Console.WriteLine($"OnCreateViewHolder... viewType: {viewType} viewID: {viewHolder.ItemView.ID}");
+
+ return viewHolder;
+ }
+
+ public override void OnBindViewHolder(FlexibleViewViewHolder holder, int position)
+ {
+ //Console.WriteLine($"OnBindItemView... position: {position}");
+ ListItemData listItemData = mDatas[position];
+
+ ListItemView listItemView = holder.ItemView as ListItemView;
+ listItemView.Name = "Item" + position;
+ //Random rd = new Random();
+ listItemView.SizeWidth = 150;
+ listItemView.SizeHeight = 60;
+ if (listItemView != null)
+ {
+ listItemView.MainText = String.Format("{0:D2}", position) + " : " + listItemData.TextString;
+ }
+ listItemView.Margin = new Extents(2, 2, 2, 2);
+ if (position % 2 == 0)
+ listItemView.BackgroundColor = Color.Cyan;
+ else
+ listItemView.BackgroundColor = Color.Yellow;
+ }
+
+ public override void OnDestroyViewHolder(FlexibleViewViewHolder holder)
+ {
+ //Console.WriteLine($"OnDestroyViewHolder... viewID: {holder.ItemView?.ID}");
+ if (holder.ItemView != null)
+ {
+ holder.ItemView.Dispose();
+ }
+ }
+
+ public override int GetItemCount()
+ {
+ return mDatas.Count;
+ }
+
+ public override void OnFocusChange(FlexibleView flexibleView, int previousFocus, int currentFocus)
+ {
+ FlexibleViewViewHolder previousFocusView = flexibleView.FindViewHolderForAdapterPosition(previousFocus);
+ if (previousFocusView != null)
+ {
+ //Console.WriteLine($"previousFocus {previousFocus.AdapterPosition}");
+ if (previousFocusView.AdapterPosition % 2 == 0)
+ previousFocusView.ItemView.BackgroundColor = Color.Cyan;
+ else
+ previousFocusView.ItemView.BackgroundColor = Color.Yellow;
+ //previousFocus.SizeWidth = 150;
+ //previousFocus.SizeHeight = 60;
+ //NotifyItemChanged(previousFocus.AdapterPosition);
+ }
+ FlexibleViewViewHolder currentFocusView = flexibleView.FindViewHolderForAdapterPosition(currentFocus);
+ if (currentFocusView != null)
+ {
+ //Console.WriteLine($"currentFocus {currentFocus.AdapterPosition}");
+ currentFocusView.ItemView.BackgroundColor = Color.Magenta;
+ //currentFocus.SizeWidth = 200;
+ //currentFocus.SizeHeight = 100;
+ //NotifyItemChanged(currentFocus.AdapterPosition);
+ }
+ }
+
+ public override void OnViewAttachedToWindow(FlexibleViewViewHolder holder)
+ {
+ //Console.WriteLine($"+Attached: {holder.AdapterPosition}");
+ }
+
+ public override void OnViewDetachedFromWindow(FlexibleViewViewHolder holder)
+ {
+ //Console.WriteLine($" --Detached: {holder.AdapterPosition}");
+ }
+ }
+
+ public static FlexibleView CreateLinearFlexibleView(Vector2 scrnSize, int orientation, int itemCount)
+ {
+ var flexibleView = new FlexibleView();
+
+ Assert.IsNotNull(flexibleView, "should be not null");
+ Assert.IsInstanceOf<FlexibleView>(flexibleView, "should be an instance of testing target class!");
+
+ Assert.IsNotNull(flexibleView.Padding, "should be not null");
+
+ flexibleView.OnRelayout(scrnSize, null);
+
+ flexibleView.Name = "RecyclerView1";
+ flexibleView.WidthSpecification = 400;
+ flexibleView.HeightSpecification = 450;
+ flexibleView.Padding = new Extents(10, 10, 10, 10);
+ flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f);
+
+ flexibleView.FocusedItemIndex = -1;
+ flexibleView.FocusedItemIndex = 0;
+
+ List<ListItemData> dataList = new List<ListItemData>();
+ for (int i = 0; i < itemCount; ++i)
+ {
+ dataList.Add(new ListItemData(i));
+ }
+
+ var adapter = new ListBridge(dataList);
+ flexibleView.SetAdapter(null);
+ flexibleView.SetAdapter(adapter);
+ flexibleView.OnRelayout(scrnSize, null);
+
+ var layoutManager = new LinearLayoutManager(orientation);
+ flexibleView.SetLayoutManager(null);
+ flexibleView.SetLayoutManager(layoutManager);
+ flexibleView.OnRelayout(scrnSize, null);
+
+ flexibleView.Focusable = true;
+
+ return flexibleView;
+ }
+
+ public static FlexibleView CreateGridFlexibleView(Vector2 scrnSize, int orientation, int itemCount)
+ {
+ var flexibleView = new FlexibleView();
+
+ Assert.IsNotNull(flexibleView, "should be not null");
+ Assert.IsInstanceOf<FlexibleView>(flexibleView, "should be an instance of testing target class!");
+
+ Assert.IsNotNull(flexibleView.Padding, "should be not null");
+
+ flexibleView.OnRelayout(scrnSize, null);
+
+ flexibleView.Name = "RecyclerView1";
+ flexibleView.WidthSpecification = 400;
+ flexibleView.HeightSpecification = 450;
+ flexibleView.Padding = new Extents(10, 10, 10, 10);
+ flexibleView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f);
+
+ flexibleView.FocusedItemIndex = -1;
+ flexibleView.FocusedItemIndex = 0;
+
+ List<ListItemData> dataList = new List<ListItemData>();
+ for (int i = 0; i < itemCount; ++i)
+ {
+ dataList.Add(new ListItemData(i));
+ }
+
+ var adapter = new ListBridge(dataList);
+ flexibleView.SetAdapter(null);
+ flexibleView.SetAdapter(adapter);
+ flexibleView.OnRelayout(scrnSize, null);
+
+ var layoutManager = new GridLayoutManager(3, orientation);
+ flexibleView.SetLayoutManager(null);
+ flexibleView.SetLayoutManager(layoutManager);
+ flexibleView.OnRelayout(scrnSize, null);
+
+ flexibleView.Focusable = true;
+
+ return flexibleView;
+ }
+ }
+}
--- /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;
+
+ class TestDefaultGridItem : DefaultGridItem
+ {
+ public void LayoutTest()
+ {
+ base.LayoutChild();
+ }
+
+ public void MeasureChildTest()
+ {
+ base.MeasureChild();
+ }
+ }
+
+ [TestFixture]
+ [Description("Controls/RecyclerView/Item/DefaultGridItem")]
+ class TSDefaultGridItem
+ {
+ 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("DefaultGridItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemConstructor()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new DefaultGridItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemConstructorWithStyle()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new DefaultGridItem("Tizen.NUI.Components.DefaultGridItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemConstructorWithItemStyle()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var itemStyle = new DefaultGridItemStyle()
+ {
+ Padding = new Extents(0, 0, 0, 0),
+ Margin = new Extents(5, 5, 5, 5),
+ Label = new TextLabelStyle()
+ {
+ SizeHeight = 60,
+ PixelSize = 24,
+ LineWrapMode = LineWrapMode.Character,
+ ThemeChangeSensitive = false
+ },
+ Badge = new ViewStyle()
+ {
+ Margin = new Extents(5, 5, 5, 5),
+ },
+ };
+
+ var testingTarget = new DefaultGridItem(itemStyle);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem Image.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.Image A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task DefaultGridItemImage()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ EventHandler onAddedToWindow = (s, e) => { tcs.TrySetResult(true); };
+
+ var testingTarget = new DefaultGridItem();
+ testingTarget.AddedToWindow += onAddedToWindow;
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Image = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Image, "DefaultGridItem image should not be null.");
+
+ testingTarget.Image.WidthSpecification = 180;
+
+ Window.Instance.Add(testingTarget);
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Relayout event should be invoked");
+
+ if (testingTarget != null)
+ {
+ Window.Instance.Remove(testingTarget);
+ testingTarget.Dispose();
+ }
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("DefaultGridItem Image.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.Image A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task DefaultGridItemImageNull()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ EventHandler onRelayout = (s, e) => { tcs.TrySetResult(true); };
+
+ var testingTarget = new DefaultGridItem();
+ testingTarget.Relayout += onRelayout;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ Window.Instance.Add(testingTarget);
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Relayout event should be invoked");
+
+ Assert.IsNotNull(testingTarget.Image, "DefaultGridItem image should not be null.");
+
+ if (testingTarget != null)
+ {
+ Window.Instance.Remove(testingTarget);
+ testingTarget.Dispose();
+ testingTarget = null;
+ }
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem Badge.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.Badge A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemBadge()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new DefaultGridItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Badge = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Badge, "DefaultGridItem Badge should not be null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem Label.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.Label A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemLabel()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new DefaultGridItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Label = new TextLabel()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Label, "DefaultGridItem Label should not be null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem Text.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.Text A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemText()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new DefaultGridItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Text = "test";
+ Assert.AreEqual(testingTarget.Text, "test", "DefaultGridItem Text should be equal to original text.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem LabelOrientationType.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.LabelOrientationType A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemLabelOrientationType()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new DefaultGridItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.LabelOrientationType = DefaultGridItem.LabelOrientation.InsideBottom;
+ Assert.AreEqual(testingTarget.LabelOrientationType, DefaultGridItem.LabelOrientation.InsideBottom, "DefaultGridItem LabelOrientationType should be equal to original value.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem ApplyStyle.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.ApplyStyle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemApplyStyle()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new DefaultGridItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ var itemStyle = new DefaultGridItemStyle()
+ {
+ Padding = new Extents(0, 0, 0, 0),
+ Margin = new Extents(5, 5, 5, 5),
+ Label = new TextLabelStyle()
+ {
+ SizeHeight = 60,
+ PixelSize = 24,
+ LineWrapMode = LineWrapMode.Character,
+ ThemeChangeSensitive = false
+ },
+ Badge = new ViewStyle()
+ {
+ Margin = new Extents(5, 5, 5, 5),
+ },
+ };
+
+ testingTarget.ApplyStyle(itemStyle);
+ Assert.IsNotNull(testingTarget.Label, "DefaultGridItem Label should not be null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem LayoutChild.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.LayoutChild M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemLayoutChildOutsideBottom()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new TestDefaultGridItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.LabelOrientationType = DefaultGridItem.LabelOrientation.OutsideBottom;
+ testingTarget.Image = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Image, "DefaultGridItem image should not be null.");
+ testingTarget.Badge = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Badge, "DefaultGridItem Badge should not be null.");
+ testingTarget.Label = new TextLabel()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Label, "DefaultGridItem Label should not be null.");
+ testingTarget.LayoutTest();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem LayoutChild.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.LayoutChild M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemLayoutChildOutsideTop()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new TestDefaultGridItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.LabelOrientationType = DefaultGridItem.LabelOrientation.OutsideTop;
+ testingTarget.Image = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Image, "DefaultGridItem image should not be null.");
+ testingTarget.Badge = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Badge, "DefaultGridItem Badge should not be null.");
+ testingTarget.Label = new TextLabel()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Label, "DefaultGridItem Label should not be null.");
+ testingTarget.LayoutTest();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem LayoutChild.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.LayoutChild M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemLayoutChildInsideBottom()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new TestDefaultGridItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.LabelOrientationType = DefaultGridItem.LabelOrientation.InsideBottom;
+ testingTarget.Image = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Image, "DefaultGridItem image should not be null.");
+ testingTarget.Badge = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Badge, "DefaultGridItem Badge should not be null.");
+ testingTarget.Label = new TextLabel()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Label, "DefaultGridItem Label should not be null.");
+ testingTarget.LayoutTest();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem LayoutChild.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.LayoutChild M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemLayoutChildInsideTop()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new TestDefaultGridItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.LabelOrientationType = DefaultGridItem.LabelOrientation.InsideTop;
+ testingTarget.Image = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Image, "DefaultGridItem image should not be null.");
+ testingTarget.Badge = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Badge, "DefaultGridItem Badge should not be null.");
+ testingTarget.LayoutTest();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem MeasureChild.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem.MeasureChild M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultGridItemMeasureChild()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new TestDefaultGridItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultGridItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.LabelOrientationType = DefaultGridItem.LabelOrientation.InsideTop;
+ testingTarget.Image = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Image, "DefaultGridItem image should not be null.");
+ testingTarget.Badge = new ImageView()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Badge, "DefaultGridItem Badge should not be null.");
+ testingTarget.Label = new TextLabel()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Label, "DefaultGridItem Label should not be null.");
+ testingTarget.MeasureChildTest();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem 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;
+
+ class TestDefaultLinearItem : DefaultLinearItem
+ {
+ public void LayoutTest()
+ {
+ base.LayoutChild();
+ }
+ }
+
+ [TestFixture]
+ [Description("Controls/RecyclerView/Item/DefaultLinearItem")]
+ class TSDefaultLinearItem
+ {
+ 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("DefaultLinearItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultLinearItemConstructor()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new DefaultLinearItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultLinearItemConstructorWithStyle()
+ {
+ tlog.Debug(tag, $"DefaultLinearItem START");
+
+ var testingTarget = new DefaultLinearItem("Tizen.NUI.Components.DefaultLinearItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultLinearItemConstructorWithItemStyle()
+ {
+ tlog.Debug(tag, $"DefaultLinearItem START");
+
+ var style = new DefaultLinearItemStyle()
+ {
+ SizeHeight = 108,
+ Padding = new Extents(64, 64, 18, 17),
+ Margin = new Extents(0, 0, 0, 0),
+ Icon = new ViewStyle()
+ {
+ Margin = new Extents(0, 32, 0, 0)
+ },
+ };
+ var testingTarget = new DefaultLinearItem(style);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItem Icon.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem.Icon A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultLinearItemIcon()
+ {
+ tlog.Debug(tag, $"DefaultLinearItem START");
+
+ var testingTarget = new DefaultLinearItem("Tizen.NUI.Components.DefaultLinearItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Icon = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ Assert.IsNotNull(testingTarget.Icon, "should be not null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItem Label.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem.Label A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultLinearItemLabel()
+ {
+ tlog.Debug(tag, $"DefaultLinearItem START");
+
+ var testingTarget = new DefaultLinearItem("Tizen.NUI.Components.DefaultLinearItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Label = new TextLabel()
+ {
+ Text = "test",
+ };
+ Assert.IsNotNull(testingTarget.Label, "should be not null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItem Text.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem.Text A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultLinearItemText()
+ {
+ tlog.Debug(tag, $"DefaultLinearItem START");
+
+ var testingTarget = new DefaultLinearItem("Tizen.NUI.Components.DefaultLinearItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Text = "test";
+ Assert.AreEqual(testingTarget.Text, "test", "should be equal.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItem SubLabel.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem.SubLabel A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultLinearItemSubLabel()
+ {
+ tlog.Debug(tag, $"DefaultLinearItem START");
+
+ var testingTarget = new DefaultLinearItem("Tizen.NUI.Components.DefaultLinearItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.SubLabel = new TextLabel()
+ {
+ Text = "test",
+ };
+ Assert.IsNotNull(testingTarget.SubLabel, "should be not null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItem SubText.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem.SubText A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultLinearSubText()
+ {
+ tlog.Debug(tag, $"DefaultLinearItem START");
+
+ var testingTarget = new DefaultLinearItem("Tizen.NUI.Components.DefaultLinearItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.SubText = "test";
+ Assert.AreEqual(testingTarget.SubText, "test", "should be equal.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItem Extra.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem.Extra A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultLinearItemExtra()
+ {
+ tlog.Debug(tag, $"DefaultLinearItem START");
+
+ var testingTarget = new DefaultLinearItem("Tizen.NUI.Components.DefaultLinearItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Extra = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ Assert.IsNotNull(testingTarget.Extra, "should be not null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItem Extra.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem.Extra A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task DefaultLinearItemExtraNull()
+ {
+ tlog.Debug(tag, $"DefaultLinearItem START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ EventHandler onAddedToWindow = (s, e) => { tcs.TrySetResult(true); };
+
+ var testingTarget = new DefaultLinearItem("Tizen.NUI.Components.DefaultLinearItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.SubLabel = new TextLabel()
+ {
+ Text = "test",
+ };
+ Assert.IsNotNull(testingTarget.SubLabel, "should be not null");
+
+ Assert.IsNotNull(testingTarget.Extra, "should be not null");
+ testingTarget.Extra.Size = new Size(100, 100);
+ testingTarget.Extra.AddedToWindow += onAddedToWindow;
+
+ Window.Instance.Add(testingTarget.Extra);
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Relayout event should be invoked");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItem Seperator.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem.Seperator A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultLinearItemSeperator()
+ {
+ tlog.Debug(tag, $"DefaultLinearItem START");
+
+ var testingTarget = new DefaultLinearItem("Tizen.NUI.Components.DefaultLinearItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ Assert.IsNotNull(testingTarget.Seperator, "should not be null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultLinearItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultLinearItem LayoutChild.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultLinearItem.LayoutChild M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultLinearItemLayoutChild()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new TestDefaultLinearItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultLinearItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Extra = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ Assert.IsNotNull(testingTarget.Extra, "should be not null");
+ testingTarget.Icon = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ Assert.IsNotNull(testingTarget.Icon, "should be not null");
+ testingTarget.Label = new TextLabel()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Label, "DefaultLinearItem Label should not be null.");
+ testingTarget.SubLabel = new TextLabel()
+ {
+ Text = "test",
+ };
+ Assert.IsNotNull(testingTarget.SubLabel, "should be not null");
+ testingTarget.LayoutTest();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem 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;
+
+ class TestDefaultTitleItem : DefaultTitleItem
+ {
+ public void LayoutTest()
+ {
+ base.LayoutChild();
+ }
+ }
+
+ [TestFixture]
+ [Description("Controls/RecyclerView/Item/DefaultTitleItem")]
+ class TSDefaultTitleItem
+ {
+ 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("DefaultTitleItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultTitleItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultTitleItemConstructor()
+ {
+ tlog.Debug(tag, $"DefaultTitleItem START");
+
+ var testingTarget = new DefaultTitleItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultTitleItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultTitleItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultTitleItemConstructorWithStyle()
+ {
+ tlog.Debug(tag, $"DefaultTitleItem START");
+
+ var testingTarget = new DefaultTitleItem("Tizen.NUI.Components.DefaultTitleItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultTitleItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultTitleItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultGridItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultGridItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultTitleItemConstructorWithItemStyle()
+ {
+ tlog.Debug(tag, $"DefaultTitleItem START");
+
+ var style = new DefaultTitleItemStyle()
+ {
+ SizeHeight = 60,
+ Padding = new Extents(64, 64, 12, 12),
+ Margin = new Extents(0, 0, 0, 0),
+ BackgroundColor = new Selector<Color>()
+ {
+ Normal = new Color("#EEEEF1"),
+ },
+ Label = new TextLabelStyle()
+ {
+ PixelSize = 28,
+ Ellipsis = true,
+ TextColor = new Color("#001447"),
+ ThemeChangeSensitive = false
+ },
+ Icon = new ViewStyle()
+ {
+ Margin = new Extents(40, 0, 0, 0)
+ },
+ Seperator = new ViewStyle()
+ {
+ Margin = new Extents(0, 0, 0, 0),
+ BackgroundColor = new Color(0, 0, 0, 0),
+ },
+ };
+ var testingTarget = new DefaultTitleItem(style);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultTitleItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultTitleItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultTitleItem Icon.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultTitleItem.Icon A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultTitleItemIcon()
+ {
+ tlog.Debug(tag, $"DefaultTitleItem START");
+
+ var testingTarget = new DefaultTitleItem("Tizen.NUI.Components.DefaultTitleItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultTitleItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Icon = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ Assert.IsNotNull(testingTarget.Icon, "should be not null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultTitleItem END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("DefaultTitleItem Icon.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultTitleItem.Icon A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task DefaultTitleItemIconNull()
+ {
+ tlog.Debug(tag, $"DefaultTitleItem START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ EventHandler onRelayout = (s, e) => { tcs.TrySetResult(true); };
+
+ var testingTarget = new DefaultTitleItem("Tizen.NUI.Components.DefaultTitleItem");
+ testingTarget.Relayout += onRelayout;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultTitleItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Label = new TextLabel()
+ {
+ Text = "test",
+ };
+ Assert.IsNotNull(testingTarget.Label, "should be not null");
+
+ Window.Instance.Add(testingTarget);
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Relayout event should be invoked");
+
+ Assert.IsNotNull(testingTarget.Icon, "should be not null");
+
+ if (testingTarget != null)
+ {
+ Window.Instance.Remove(testingTarget);
+ testingTarget.Dispose();
+ testingTarget = null;
+ }
+ tlog.Debug(tag, $"DefaultTitleItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultTitleItem Label.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultTitleItem.Label A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultTitleItemLabel()
+ {
+ tlog.Debug(tag, $"DefaultTitleItem START");
+
+ var testingTarget = new DefaultTitleItem("Tizen.NUI.Components.DefaultTitleItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultTitleItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Label = new TextLabel()
+ {
+ Text = "test",
+ };
+ Assert.IsNotNull(testingTarget.Label, "should be not null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultTitleItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultTitleItem Text.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultTitleItem.Text A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultTitleItemText()
+ {
+ tlog.Debug(tag, $"DefaultTitleItem START");
+
+ var testingTarget = new DefaultTitleItem("Tizen.NUI.Components.DefaultTitleItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultTitleItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Text = "test";
+ Assert.AreEqual(testingTarget.Text, "test", "should be equal.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultTitleItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultTitleItem Seperator.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultTitleItem.Seperator A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultTitleItemSeperator()
+ {
+ tlog.Debug(tag, $"DefaultTitleItem START");
+
+ var testingTarget = new DefaultTitleItem("Tizen.NUI.Components.DefaultTitleItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultTitleItem>(testingTarget, "should be an instance of testing target class!");
+
+ Assert.IsNotNull(testingTarget.Seperator, "should not be null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultTitleItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("DefaultTitleItem LayoutChild.")]
+ [Property("SPEC", "Tizen.NUI.Components.DefaultTitleItem.LayoutChild M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void DefaultTitleItemLayoutChild()
+ {
+ tlog.Debug(tag, $"DefaultGridItem START");
+
+ var testingTarget = new TestDefaultTitleItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<DefaultTitleItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Icon = new View()
+ {
+ Size = new Size(100, 100),
+ };
+ Assert.IsNotNull(testingTarget.Icon, "should be not null");
+ testingTarget.Label = new TextLabel()
+ {
+ WidthSpecification = 170,
+ HeightSpecification = 170,
+ };
+ Assert.IsNotNull(testingTarget.Label, "DefaultTitleItem Label should not be null.");
+ testingTarget.LayoutTest();
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"DefaultGridItem END (OK)");
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+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]
+ [Description("Controls/RecyclerView/Item/RecyclerViewItem")]
+ class TSRecyclerViewItem
+ {
+ 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("RecyclerViewItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemConstructor()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemConstructorWithStyle()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem("Tizen.NUI.Components.RecyclerViewItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemConstructorWithItemStyle()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var style = new RecyclerViewItemStyle()
+ {
+ BackgroundColor = new Selector<Color>()
+ {
+ Normal = new Color(1, 1, 1, 1),
+ Pressed = new Color(0.85f, 0.85f, 0.85f, 1),
+ Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
+ Selected = new Color(0.701f, 0.898f, 0.937f, 1),
+ },
+ };
+ var testingTarget = new RecyclerViewItem(style);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem IsSelectable.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem.IsSelectable A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemIsSelectable()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem("Tizen.NUI.Components.RecyclerViewItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.IsSelectable = true;
+ Assert.IsTrue(testingTarget.IsSelectable, "should be selectable.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem IsSelected.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem.IsSelected A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemIsSelected()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem("Tizen.NUI.Components.RecyclerViewItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.IsSelected = true;
+ Assert.IsTrue(testingTarget.IsSelected, "should be selected.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem IsEnabled.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem.IsEnabled A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemIsEnabled()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem("Tizen.NUI.Components.RecyclerViewItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.IsEnabled = true;
+ Assert.IsTrue(testingTarget.IsEnabled, "should be enabled.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem Index.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem.Index A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemIndex()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem("Tizen.NUI.Components.RecyclerViewItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Index = 0;
+ Assert.AreEqual(testingTarget.Index, 0, "should be equal to 0.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem Template.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem.Template A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemTemplate()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem("Tizen.NUI.Components.RecyclerViewItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Template = 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;
+ });
+ Assert.IsNotNull(testingTarget.Template, "should not be null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem IsRealized.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem.IsRealized A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemIsRealized()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem("Tizen.NUI.Components.RecyclerViewItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.IsRealized = true;
+ Assert.IsTrue(testingTarget.IsRealized, "should be realized.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem IsHeader.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem.IsHeader A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemIsHeader()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem("Tizen.NUI.Components.RecyclerViewItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.IsHeader = true;
+ Assert.IsTrue(testingTarget.IsHeader, "should be header.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem IsFooter.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem.IsFooter A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemIsFooter()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem("Tizen.NUI.Components.RecyclerViewItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.IsFooter = true;
+ Assert.IsTrue(testingTarget.IsFooter, "should be footer.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem IsPressed.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem.IsPressed A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemIsPressed()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem("Tizen.NUI.Components.RecyclerViewItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.IsPressed = true;
+ Assert.IsTrue(testingTarget.IsPressed, "should be pressed.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("RecyclerViewItem OnKey.")]
+ [Property("SPEC", "Tizen.NUI.Components.RecyclerViewItem.OnKey M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void RecyclerViewItemOnKey()
+ {
+ tlog.Debug(tag, $"RecyclerViewItem START");
+
+ var testingTarget = new RecyclerViewItem("Tizen.NUI.Components.RecyclerViewItem");
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");
+
+ var key = new Key()
+ {
+ State = Key.StateType.Up,
+ KeyPressedName = "Return"
+ };
+ Assert.IsFalse(testingTarget.OnKey(key), "should not be processed.");
+
+ key = new Key()
+ {
+ State = Key.StateType.Down,
+ KeyPressedName = "Return"
+ };
+ Assert.IsFalse(testingTarget.OnKey(key), "should not be processed.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RecyclerViewItem END (OK)");
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Controls/RecyclerView/ItemSource/EmptySource")]
+ class TSEmptySource
+ {
+ 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("EmptySource Count.")]
+ [Property("SPEC", "Tizen.NUI.Components.EmptySource.Count A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void EmptySourceCount()
+ {
+ tlog.Debug(tag, $"EmptySourceCount START");
+
+ var testingTarget = new EmptySource();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<EmptySource>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.Count, 0, "Count of EmptySource should be equal to 0.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"EmptySourceCount END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("EmptySource HasHeader.")]
+ [Property("SPEC", "Tizen.NUI.Components.EmptySource.HasHeader A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void EmptySourceHasHeader()
+ {
+ tlog.Debug(tag, $"EmptySourceHasHeader START");
+
+ var testingTarget = new EmptySource();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<EmptySource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasHeader = true;
+ Assert.IsTrue(testingTarget.HasHeader, "EmptySource should have a header.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"EmptySourceHasHeader END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("EmptySource HasFooter.")]
+ [Property("SPEC", "Tizen.NUI.Components.EmptySource.HasFooter A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void EmptySourceHasFooter()
+ {
+ tlog.Debug(tag, $"EmptySourceHasFooter START");
+
+ var testingTarget = new EmptySource();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<EmptySource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasFooter = true;
+ Assert.IsTrue(testingTarget.HasFooter, "EmptySource should have a footer.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"EmptySourceHasFooter END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("EmptySource IsHeader.")]
+ [Property("SPEC", "Tizen.NUI.Components.EmptySource.IsHeader M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void EmptySourceIsHeader()
+ {
+ tlog.Debug(tag, $"EmptySourceIsHeader START");
+
+ var testingTarget = new EmptySource();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<EmptySource>(testingTarget, "should be an instance of testing target class!");
+ testingTarget.HasHeader = true;
+ Assert.IsTrue(testingTarget.IsHeader(0), "The first item of EmptySource should is header.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"EmptySourceIsHeader END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("EmptySource IsFooter.")]
+ [Property("SPEC", "Tizen.NUI.Components.EmptySource.IsFooter M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void EmptySourceIsFooter()
+ {
+ tlog.Debug(tag, $"EmptySourceIsFooter START");
+
+ var testingTarget = new EmptySource();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<EmptySource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasFooter = true;
+ Assert.IsTrue(testingTarget.IsFooter(0), "The last item of EmptySource should is footer.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"EmptySourceIsFooter END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("EmptySource IsFooter.")]
+ [Property("SPEC", "Tizen.NUI.Components.EmptySource.IsFooter M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void EmptySourceIsFooterWithHeader()
+ {
+ tlog.Debug(tag, $"EmptySourceIsFooterWithHeader START");
+
+ var testingTarget = new EmptySource();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<EmptySource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasHeader = true;
+ tlog.Debug(tag, "IsFooter : " + testingTarget.IsFooter(1));
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"EmptySourceIsFooterWithHeader END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("EmptySource IsFooter.")]
+ [Property("SPEC", "Tizen.NUI.Components.EmptySource.IsFooter M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void EmptySourceIsFooterWithoutFooter()
+ {
+ tlog.Debug(tag, $"EmptySourceIsFooterWithoutFooter START");
+
+ var testingTarget = new EmptySource();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<EmptySource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasFooter = false;
+ Assert.IsFalse(testingTarget.IsFooter(0), "EmptySource should not have footer.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"EmptySourceIsFooterWithoutFooter END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("EmptySource GetPosition.")]
+ [Property("SPEC", "Tizen.NUI.Components.EmptySource.GetPosition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void EmptySourceGetPosition()
+ {
+ tlog.Debug(tag, $"EmptySourceGetPosition START");
+
+ var testingTarget = new EmptySource();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<EmptySource>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.GetPosition(0), -1, "The index of the first item of EmptySource should be -1.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"EmptySourceGetPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("EmptySource GetItem.")]
+ [Property("SPEC", "Tizen.NUI.Components.EmptySource.GetItem M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void EmptySourceGetItem()
+ {
+ tlog.Debug(tag, $"EmptySourceGetItem START");
+
+ var testingTarget = new EmptySource();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<EmptySource>(testingTarget, "should be an instance of testing target class!");
+
+ try
+ {
+ var ret = testingTarget.GetItem(0);
+ }
+ catch (IndexOutOfRangeException e)
+ {
+ Assert.AreEqual(e.Message, "IItemSource is empty", "GetItem of EmptySource should not be implemented.");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"EmptySourceGetItem END (OK)");
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Controls/RecyclerView/ItemSource/ListSource")]
+ class ListSourceTest
+ {
+ private const string tag = "NUITEST";
+
+ private class TestEnumerable : IEnumerable
+ {
+ private ArrayList mylist = new ArrayList();
+
+ public TestEnumerable()
+ {
+ mylist.Add(1);
+ mylist.Add(2);
+ mylist.Add(3);
+ }
+
+ public IEnumerator GetEnumerator()
+ {
+ return mylist.GetEnumerator();
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceConstructor()
+ {
+ tlog.Debug(tag, $"ListSourceConstructor START");
+
+ var testingTarget = new ListSource();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceConstructorWithEnumerableObject()
+ {
+ tlog.Debug(tag, $"ListSourceConstructorWithEnumerableObject START");
+
+ IEnumerable<string> para = new List<string>();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceConstructorWithEnumerableObject END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceConstructorWithEnumerable()
+ {
+ tlog.Debug(tag, $"ListSourceConstructorWithEnumerable START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceConstructorWithEnumerable END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("ListSource constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceConstructorWithEnumerableNull()
+ {
+ tlog.Debug(tag, $"ListSourceConstructorWithEnumerableNull START");
+
+ var testingTarget = new ListSource((IEnumerable)null);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceConstructorWithEnumerableNull END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource Count.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.Count A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceCount()
+ {
+ tlog.Debug(tag, $"ListSourceCount START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.Count, 3, "Count of ListSouce should be equal to 3.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceCount END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource HasHeader.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.HasHeader A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceHasHeader()
+ {
+ tlog.Debug(tag, $"ListSourceHasHeader START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasHeader = true;
+ Assert.IsTrue(testingTarget.HasHeader, "ListSouce should have a header.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceHasHeader END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource HasFooter.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.HasFooter A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceHasFooter()
+ {
+ tlog.Debug(tag, $"ListSourceHasFooter START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasFooter = true;
+ Assert.IsTrue(testingTarget.HasFooter, "ListSouce should have a footer.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceHasFooter END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource IsReadOnly.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.IsReadOnly A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceIsReadOnly()
+ {
+ tlog.Debug(tag, $"ListSourceIsReadOnly START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ tlog.Debug(tag, "IsReadOnly : " + testingTarget.IsReadOnly);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceIsReadOnly END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource IsFixedSize.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.IsFixedSize A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceIsFixedSize()
+ {
+ tlog.Debug(tag, $"ListSourceIsFixedSize START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ tlog.Debug(tag, "IsFixedSize : " + testingTarget.IsFixedSize);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceIsFixedSize END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource SyncRoot.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.SyncRoot A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceSyncRoot()
+ {
+ tlog.Debug(tag, $"ListSourceSyncRoot START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+ Assert.IsNotNull(testingTarget.SyncRoot, "SyncRoot of ListSouce should not be null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceSyncRoot END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource IsSynchronized.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.IsSynchronized A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceIsSynchronized()
+ {
+ tlog.Debug(tag, $"ListSourceIsSynchronized START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ tlog.Debug(tag, "IsSynchronized : " + testingTarget.IsSynchronized);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceIsSynchronized END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource IsFooter.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.IsFooter M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceIsFooter()
+ {
+ tlog.Debug(tag, $"ListSourceIsFooter START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasFooter = true;
+ tlog.Debug(tag, "IsFooter : " + testingTarget.IsFooter(2));
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceIsFooter END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource IsHeader.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.IsHeader M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceIsHeader()
+ {
+ tlog.Debug(tag, $"ListSourceIsHeader START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasHeader = true;
+ Assert.IsTrue(testingTarget.IsHeader(0), "The first item of ListSouce should be header.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceIsHeader END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource GetPosition.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.GetPosition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceGetPosition()
+ {
+ tlog.Debug(tag, $"ListSourceGetPosition START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.GetPosition(1), 0, "The index of the first item of ListSouce should be 0.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceGetPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource GetItem.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.GetItem M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceGetItem()
+ {
+ tlog.Debug(tag, $"ListSourceGetItem START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.GetItem(0), 1, "The value of the first item of ListSouce should be 1.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceGetItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource Add.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.Add M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceAdd()
+ {
+ tlog.Debug(tag, $"ListSourceAdd START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ var ret = testingTarget.Add(4);
+ Assert.AreEqual(ret, 3, "The index of ListSouce should is 3.");
+ Assert.AreEqual(testingTarget.Count, 4, "The count of ListSouce should be 4.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceAdd END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource Contains.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.Contains M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceContains()
+ {
+ tlog.Debug(tag, $"ListSourceContains START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ var ret = testingTarget.Contains(3);
+ Assert.IsTrue(ret, "The ListSouce should contain 3.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceContains END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource Clear.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.Clear M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceClear()
+ {
+ tlog.Debug(tag, $"ListSourceClear START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Clear();
+ Assert.AreEqual(testingTarget.Count, 0, "The ListSouce should be empty after cleared.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceClear END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource IndexOf.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.IndexOf M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceIndexOf()
+ {
+ tlog.Debug(tag, $"ListSourceIndexOf START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ var ret = testingTarget.IndexOf(1);
+ Assert.AreEqual(ret, 0, "The index of ListSouce should be 0.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceIndexOf END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource Insert.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.Insert M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceInsert()
+ {
+ tlog.Debug(tag, $"ListSourceInsert START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Insert(2, 4);
+ Assert.AreEqual(testingTarget.Count, 4, "The count of ListSouce should be 4.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceInsert END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource Remove.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.Remove M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceRemove()
+ {
+ tlog.Debug(tag, $"ListSourceRemove START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Remove(3);
+ Assert.AreEqual(testingTarget.Count, 2, "The count of ListSouce should be 2.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceRemove END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource RemoveAt.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.RemoveAt M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceRemoveAt()
+ {
+ tlog.Debug(tag, $"ListSourceRemoveAt START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.RemoveAt(2);
+ Assert.AreEqual(testingTarget.Count, 2, "The count of ListSouce should be 2.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceRemoveAt END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource CopyTo.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.CopyTo M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceCopyTo()
+ {
+ tlog.Debug(tag, $"ListSourceCopyTo START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ Array intArray = Array.CreateInstance(typeof(int), 10);
+ intArray.SetValue(4, 0);
+ testingTarget.CopyTo(intArray, 2);
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceCopyTo END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ListSource GetEnumerator.")]
+ [Property("SPEC", "Tizen.NUI.Components.ListSource.GetEnumerator M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ListSourceGetEnumerator()
+ {
+ tlog.Debug(tag, $"ListSourceGetEnumerator START");
+
+ var para = new TestEnumerable();
+ var testingTarget = new ListSource(para);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ListSource>(testingTarget, "should be an instance of testing target class!");
+
+ var ret = testingTarget.GetEnumerator();
+ Assert.IsNotNull(ret, "The Enumerator of ListSouce should not be null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ListSourceGetEnumerator END (OK)");
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Controls/RecyclerView/ItemSource/MarshalingObservableCollection")]
+ class TSMarshalingObservableCollection
+ {
+ private const string tag = "NUITEST";
+
+ 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;
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MarshalingObservableCollection CollectionChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.MarshalingObservableCollection.CollectionChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task MarshalingObservableCollectionCollectionChangedAdd()
+ {
+ tlog.Debug(tag, $"MarshalingObservableCollectionCollectionChangedAdd START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var para = new TestModel();
+ var testingTarget = new MarshalingObservableCollection(para);
+ testingTarget.CollectionChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<MarshalingObservableCollection>(testingTarget, "should be an instance of testing target class!");
+
+ para.Add("Test");
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ Assert.AreEqual(testingTarget.Count, 21, "should be equal.");
+
+ tlog.Debug(tag, $"MarshalingObservableCollectionCollectionChangedAdd END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MarshalingObservableCollection CollectionChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.MarshalingObservableCollection.CollectionChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task MarshalingObservableCollectionCollectionChangedRemove()
+ {
+ tlog.Debug(tag, $"MarshalingObservableCollectionCollectionChangedRemove START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var para = new TestModel();
+ var testingTarget = new MarshalingObservableCollection(para);
+ testingTarget.CollectionChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<MarshalingObservableCollection>(testingTarget, "should be an instance of testing target class!");
+
+ para.Remove("Cat");
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ Assert.AreEqual(testingTarget.Count, 19, "should be equal.");
+
+ tlog.Debug(tag, $"MarshalingObservableCollectionCollectionChangedRemove END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MarshalingObservableCollection CollectionChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.MarshalingObservableCollection.CollectionChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task MarshalingObservableCollectionCollectionChangedReplace()
+ {
+ tlog.Debug(tag, $"MarshalingObservableCollectionCollectionChangedReplace START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var para = new TestModel();
+ var testingTarget = new MarshalingObservableCollection(para);
+ testingTarget.CollectionChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<MarshalingObservableCollection>(testingTarget, "should be an instance of testing target class!");
+
+ para[0] = "Abc";
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ Assert.AreEqual(testingTarget.Count, 20, "should be equal.");
+
+ tlog.Debug(tag, $"MarshalingObservableCollectionCollectionChangedReplace END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("MarshalingObservableCollection CollectionChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.MarshalingObservableCollection.CollectionChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task MarshalingObservableCollectionCollectionChangedMove()
+ {
+ tlog.Debug(tag, $"MarshalingObservableCollectionCollectionChangedMove START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var para = new TestModel();
+ var testingTarget = new MarshalingObservableCollection(para);
+ testingTarget.CollectionChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<MarshalingObservableCollection>(testingTarget, "should be an instance of testing target class!");
+
+ para.Move(0, 2);
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ Assert.AreEqual(testingTarget.Count, 20, "should be equal.");
+
+ tlog.Debug(tag, $"MarshalingObservableCollectionCollectionChangedMove END (OK)");
+ }
+ }
+}
--- /dev/null
+using NUnit.Framework;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Controls/RecyclerView/ItemSource/ObservableGroupedSource")]
+ class TSObservableGroupedSource
+ {
+ private const string tag = "NUITEST";
+
+ 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;
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ObservableGroupedSourceConstructor()
+ {
+ tlog.Debug(tag, $"ObservableGroupedSourceConstructor START");
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ObservableGroupedSourceConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource Count.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource.Count A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ObservableGroupedSourceCount()
+ {
+ tlog.Debug(tag, $"ObservableGroupedSourceCount START");
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ObservableGroupedSourceCount END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource HasHeader.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource.HasHeader A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ObservableGroupedSourceHasHeader()
+ {
+ tlog.Debug(tag, $"ObservableGroupedSourceHasHeader START");
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasHeader = true;
+ Assert.IsTrue(testingTarget.HasHeader, "should be true.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ObservableGroupedSourceHasHeader END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource HasFooter.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource.HasFooter A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ObservableGroupedSourceHasFooter()
+ {
+ tlog.Debug(tag, $"ObservableGroupedSourceHasFooter START");
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasFooter = true;
+ Assert.IsTrue(testingTarget.HasFooter, "should be true.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ObservableGroupedSourceHasFooter END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource IsFooter.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource.IsFooter M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ObservableGroupedSourceIsFooter()
+ {
+ tlog.Debug(tag, $"ObservableGroupedSourceIsFooter START");
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasFooter = true;
+ tlog.Debug(tag, "IsFooter : " + testingTarget.IsFooter(19));
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ObservableGroupedSourceIsFooter END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource IsHeader.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource.IsHeader M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ObservableGroupedSourceIsHeader()
+ {
+ tlog.Debug(tag, $"ObservableGroupedSourceIsHeader START");
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasHeader = true;
+ Assert.IsTrue(testingTarget.IsHeader(0), "The item should be footer.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ObservableGroupedSourceIsHeader END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource GetPosition.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource.GetPosition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ObservableGroupedSourceGetPosition()
+ {
+ tlog.Debug(tag, $"ObservableGroupedSourceGetPosition START");
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+
+ Assert.AreEqual(testingTarget.GetPosition("Cat"), 0, "should be equal.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ObservableGroupedSourceGetPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource CollectionItemsSourceChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource.CollectionItemsSourceChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task ObservableGroupedSourceCollectionItemsSourceChangedMove()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+ model.CollectionChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+
+ model.Move(0, 2);
+ testingTarget.NotifyItemMoved(testingTarget, 0, 2);
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource CollectionItemsSourceChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource.CollectionItemsSourceChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task ObservableGroupedSourceCollectionItemsSourceChangedAdd()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+ model.CollectionChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+
+ model.Add("test");
+ testingTarget.NotifyItemInserted(testingTarget, model.Count - 1);
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource CollectionItemsSourceChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource.CollectionItemsSourceChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task ObservableGroupedSourceCollectionItemsSourceChangedRemove()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+ model.CollectionChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+
+ model.Add("test");
+ model.Remove("test");
+ testingTarget.NotifyItemRemoved(testingTarget, model.Count - 1);
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource CollectionItemsSourceChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource.CollectionItemsSourceChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task ObservableGroupedSourceCollectionItemsSourceChangedReset()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+ model.CollectionChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+
+ model.Clear();
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableGroupedSource CollectionItemsSourceChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableGroupedSource.CollectionItemsSourceChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task ObservableGroupedSourceCollectionItemsSourceChangedReplace()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var model = new TestModel();
+ var cView = new CollectionView(model);
+ var testingTarget = new ObservableGroupedSource(cView, cView);
+ model.CollectionChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableGroupedSource>(testingTarget, "should be an instance of testing target class!");
+
+ model[0] = "test";
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ tlog.Debug(tag, "Count : " + testingTarget.Count);
+
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged 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 System.Threading.Tasks;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Controls/RecyclerView/ItemSource/ObservableItemSource")]
+ class TSObservableItemSource
+ {
+ private const string tag = "NUITEST";
+
+ 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;
+ }
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableItemSource IsFooter.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableItemSource.IsFooter M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ObservableItemSourceIsFooter()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceIsFooter START");
+
+ var para = new TestModel();
+ var cView = new CollectionView(para);
+ var testingTarget = new ObservableItemSource(cView.ItemsSource, cView);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableItemSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasFooter = true;
+ Assert.IsFalse(testingTarget.IsFooter(18), "should be false.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ObservableItemSourceIsFooter END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableItemSource IsHeader.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableItemSource.IsHeader M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ObservableItemSourceIsHeader()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceIsHeader START");
+
+ var para = new TestModel();
+ var cView = new CollectionView(para);
+ var testingTarget = new ObservableItemSource(cView.ItemsSource, cView);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableItemSource>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.HasHeader = true;
+ Assert.IsTrue(testingTarget.IsHeader(0), "should be true.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ObservableItemSourceIsHeader END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableItemSource GetPosition.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableItemSource.GetPosition M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ObservableItemSourceGetPosition()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceGetPosition START");
+
+ var para = new TestModel();
+ var cView = new CollectionView(para);
+ var testingTarget = new ObservableItemSource(cView.ItemsSource, cView);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableItemSource>(testingTarget, "should be an instance of testing target class!");
+ Assert.AreEqual(testingTarget.GetPosition("Cat"), 0, "should be equal.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ObservableItemSourceGetPosition END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableItemSource GetItem.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableItemSource.GetItem M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void ObservableItemSourceGetItem()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceGetItem START");
+
+ var para = new TestModel();
+ var cView = new CollectionView(para);
+ var testingTarget = new ObservableItemSource(cView.ItemsSource, cView);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableItemSource>(testingTarget, "should be an instance of testing target class!");
+ Assert.IsNotNull(testingTarget.GetItem(0), "should not be null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"ObservableItemSourceGetItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableItemSource CollectionItemsSourceChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableItemSource.CollectionItemsSourceChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task ObservableItemSourceCollectionItemsSourceChangedMove()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var para = new TestModel();
+ var cView = new CollectionView(para);
+ var testingTarget = new ObservableItemSource(cView.ItemsSource, cView);
+ testingTarget.CollectionItemsSourceChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableItemSource>(testingTarget, "should be an instance of testing target class!");
+
+ para.Move(0, 2);
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ Assert.AreEqual(testingTarget.Count, 20, "should be equal.");
+
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableItemSource CollectionItemsSourceChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableItemSource.CollectionItemsSourceChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task ObservableItemSourceCollectionItemsSourceChangedAdd()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var para = new TestModel();
+ var cView = new CollectionView(para);
+ var testingTarget = new ObservableItemSource(cView.ItemsSource, cView);
+ testingTarget.CollectionItemsSourceChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableItemSource>(testingTarget, "should be an instance of testing target class!");
+
+ para.Add("test");
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ Assert.AreEqual(testingTarget.Count, 21, "should be equal.");
+
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableItemSource CollectionItemsSourceChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableItemSource.CollectionItemsSourceChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task ObservableItemSourceCollectionItemsSourceChangedRemove()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var para = new TestModel();
+ var cView = new CollectionView(para);
+ var testingTarget = new ObservableItemSource(cView.ItemsSource, cView);
+ testingTarget.CollectionItemsSourceChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableItemSource>(testingTarget, "should be an instance of testing target class!");
+
+ para.Add("test");
+ para.Remove("test");
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ Assert.AreEqual(testingTarget.Count, 20, "should be equal.");
+
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("ObservableItemSource CollectionItemsSourceChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.ObservableItemSource.CollectionItemsSourceChanged E")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "EVL")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task ObservableItemSourceCollectionItemsSourceChangedReset()
+ {
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ NotifyCollectionChangedEventHandler onChanged = (s, e) => { tcs.TrySetResult(true); };
+
+ var para = new TestModel();
+ var cView = new CollectionView(para);
+ var testingTarget = new ObservableItemSource(cView.ItemsSource, cView);
+ testingTarget.CollectionItemsSourceChanged += onChanged;
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<ObservableItemSource>(testingTarget, "should be an instance of testing target class!");
+
+ para[0] = "test";
+ para.Clear();
+
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Change event should be invoked");
+ Assert.AreEqual(testingTarget.Count, 0, "should be equal.");
+
+ tlog.Debug(tag, $"ObservableItemSourceCollectionItemsSourceChanged 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 Tizen.NUI.Binding;
+using System.Collections.Generic;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Controls/RecyclerView/Layouter")]
+ public class TSGridLayouter
+ {
+ private const string tag = "NUITEST";
+ private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "index.xml";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayouter Initialize.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayouter.Initialize M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayouterInitialize()
+ {
+ tlog.Debug(tag, $"GridLayouterInitialize 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);
+
+ view.Dispose();
+ gridLayouter.Dispose();
+
+ tlog.Debug(tag, $"GridLayouterInitialize END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayouter RequestLayout.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayouter.RequestLayout M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayouterRequestLayout()
+ {
+ tlog.Debug(tag, $"GridLayouterRequestLayout 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);
+
+ gridLayouter.RequestLayout(5.0f);
+
+ gridLayouter.RequestLayout(150.0f, true);
+
+ view.Dispose();
+ gridLayouter.Dispose();
+
+ tlog.Debug(tag, $"GridLayouterRequestLayout END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayouter Clear.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayouter.Clear M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayouterClear()
+ {
+ tlog.Debug(tag, $"GridLayouterClear START");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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(100.0f);
+ gridLayouter.Clear();
+
+ view.Dispose();
+ gridLayouter.Dispose();
+
+ tlog.Debug(tag, $"GridLayouterClear END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayouter NotifyItemInserted.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayouter.NotifyItemInserted M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayouterNotifyItemInserted()
+ {
+ tlog.Debug(tag, $"GridLayouterNotifyItemInserted");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+ gridLayouter.NotifyItemInserted(source, 0);
+
+ source.Position = 4;
+ gridLayouter.NotifyItemInserted(source, 0);
+
+ gridLayouter.NotifyItemInserted(source, 1);
+
+ var emptySource = new CustomEmptySource();
+ gridLayouter.NotifyItemInserted(emptySource, 1);
+
+ var item = new RecyclerViewItem()
+ {
+ Size = new Size(200, 100),
+ };
+ gridLayouter.NotifyItemSizeChanged(item);
+ item.Dispose();
+
+ view.Dispose();
+ gridLayouter.Dispose();
+
+ source.Dispose();
+ emptySource.Dispose();
+
+ tlog.Debug(tag, $"GridLayouterNotifyItemInserted END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayouter NotifyItemRangeInserted.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayouter.NotifyItemRangeInserted M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayouterNotifyItemRangeInserted()
+ {
+ tlog.Debug(tag, $"GridLayouterNotifyItemRangeInserted");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ FooterIndex = 2,
+ };
+ gridLayouter.NotifyItemRangeInserted(source, 0, 3);
+
+ source.Position = 6;
+ gridLayouter.NotifyItemRangeInserted(source, 0, 1);
+
+ gridLayouter.NotifyItemRangeInserted(source, 1, 1);
+
+ view.Dispose();
+ gridLayouter.Dispose();
+
+ source.Dispose();
+
+ tlog.Debug(tag, $"GridLayouterNotifyItemRangeInserted END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayouter NotifyItemRemoved.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayouter.NotifyItemRemoved M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayouterNotifyItemRemoved()
+ {
+ tlog.Debug(tag, $"GridLayouterNotifyItemRemoved");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+
+ gridLayouter.NotifyItemRangeInserted(source, 0, 1);
+ gridLayouter.NotifyItemRemoved(source, 0);
+
+ gridLayouter.NotifyItemRangeInserted(source, 0, 2);
+ gridLayouter.NotifyItemRemoved(source, 1);
+
+ var emptySource = new CustomEmptySource();
+ gridLayouter.NotifyItemInserted(emptySource, 1);
+ gridLayouter.NotifyItemRemoved(emptySource, 1);
+
+ view.Dispose();
+ gridLayouter.Dispose();
+
+ source.Dispose();
+ emptySource.Dispose();
+
+ tlog.Debug(tag, $"GridLayouterNotifyItemRemoved END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayouter NotifyItemRangeRemoved.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayouter.NotifyItemRangeRemoved M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayouterNotifyItemRangeRemoved()
+ {
+ tlog.Debug(tag, $"GridLayouterNotifyItemRangeRemoved");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+
+ gridLayouter.NotifyItemRangeInserted(source, 0, 1);
+ gridLayouter.NotifyItemRangeRemoved(source, 0, 1);
+
+ view.Dispose();
+ gridLayouter.Dispose();
+
+ source.Dispose();
+
+ tlog.Debug(tag, $"GridLayouterNotifyItemRangeRemoved END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayouter NotifyItemMoved.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayouter.NotifyItemMoved M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayouterNotifyItemMoved()
+ {
+ tlog.Debug(tag, $"GridLayouterNotifyItemMoved");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+
+ gridLayouter.NotifyItemRangeInserted(source, 0, 10);
+ gridLayouter.NotifyItemMoved(source, 1, 22);
+
+ view.Dispose();
+ gridLayouter.Dispose();
+
+ source.Dispose();
+
+ tlog.Debug(tag, $"GridLayouterNotifyItemMoved END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayouter NotifyItemRangeMoved.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayouter.NotifyItemRangeMoved M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayouterNotifyItemRangeMoved()
+ {
+ tlog.Debug(tag, $"GridLayouterNotifyItemRangeMoved");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+
+ var orientationSize = gridLayouter.CalculateLayoutOrientationSize();
+ Assert.AreEqual(orientationSize, 6);
+
+ var scrollPosition = gridLayouter.CalculateCandidateScrollPosition(0.0f);
+ Assert.AreEqual(scrollPosition, 0.0f);
+
+ gridLayouter.NotifyItemRangeInserted(source, 0, 10);
+ gridLayouter.NotifyItemRangeMoved(source, 11, 16, 5);
+
+ view.Dispose();
+ gridLayouter.Dispose();
+
+ source.Dispose();
+
+ tlog.Debug(tag, $"GridLayouterNotifyItemRangeMoved END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("GridLayouter RequestNextFocusableView.")]
+ [Property("SPEC", "Tizen.NUI.Components.GridLayouter.RequestNextFocusableView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void GridLayouterRequestNextFocusableView()
+ {
+ tlog.Debug(tag, $"GridLayouterRequestNextFocusableView");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+
+ var orientationSize = gridLayouter.CalculateLayoutOrientationSize();
+ Assert.AreEqual(orientationSize, 6);
+
+ var scrollPosition = gridLayouter.CalculateCandidateScrollPosition(0.0f);
+ Assert.AreEqual(scrollPosition, 0.0f);
+
+ gridLayouter.NotifyItemRangeInserted(source, 0, 10);
+
+ gridLayouter.RequestNextFocusableView(view, View.FocusDirection.Up, true);
+ gridLayouter.RequestNextFocusableView(view, View.FocusDirection.Down, true);
+ gridLayouter.RequestNextFocusableView(view, View.FocusDirection.PageUp, true);
+ gridLayouter.RequestNextFocusableView(view, View.FocusDirection.PageDown, true);
+ gridLayouter.RequestNextFocusableView(view, View.FocusDirection.Left, true);
+ gridLayouter.RequestNextFocusableView(view, View.FocusDirection.Right, true);
+
+ view.Dispose();
+ gridLayouter.Dispose();
+
+ source.Dispose();
+
+ tlog.Debug(tag, $"GridLayouterRequestNextFocusableView 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
+{
+ internal sealed class CustomGroupItemSource : IGroupableItemSource
+ {
+ public CustomGroupItemSource(object parent)
+ {
+ this.parent = parent as CollectionView;
+ }
+
+ public int Count => 0;
+
+ public bool HasHeader { get; set; } = true;
+ public bool HasFooter { get; set; } = true;
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool IsHeader(int index)
+ {
+ return HasHeader && index == 0;
+ }
+
+ public bool IsFooter(int index)
+ {
+ if (!HasFooter)
+ {
+ return false;
+ }
+
+ if (HasHeader)
+ {
+ return index == 1;
+ }
+
+ return index == 0;
+ }
+
+ public int GetPosition(object item)
+ {
+ return Position;
+ }
+
+ internal int Position
+ {
+ set;
+ get;
+ }
+
+ public object GetItem(int position)
+ {
+ throw new IndexOutOfRangeException("IItemSource is empty");
+ }
+
+ public bool IsGroupHeader(int position)
+ {
+ return null != parent.Header;
+ }
+
+ public bool IsGroupFooter(int position)
+ {
+ return position == FooterIndex;
+ }
+
+ internal int FooterIndex
+ {
+ get;
+ set;
+ } = -1;
+
+ public object GetGroupParent(int position)
+ {
+ return parent;
+ }
+
+ private CollectionView parent;
+ }
+
+ internal sealed class CustomEmptySource : IItemSource
+ {
+ public int Count => 0;
+
+ public bool HasHeader { get; set; }
+ public bool HasFooter { get; set; }
+
+ public void Dispose()
+ {
+
+ }
+
+ public bool IsHeader(int index)
+ {
+ return HasHeader && index == 0;
+ }
+
+ public bool IsFooter(int index)
+ {
+ if (!HasFooter)
+ {
+ return false;
+ }
+
+ if (HasHeader)
+ {
+ return index == 1;
+ }
+
+ return index == 0;
+ }
+
+ public int GetPosition(object item)
+ {
+ return -1;
+ }
+
+ public object GetItem(int position)
+ {
+ throw new IndexOutOfRangeException("IItemSource is empty");
+ }
+ }
+}
--- /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 TSLinearLayouter
+ {
+ private const string tag = "NUITEST";
+ private string path = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "index.xml";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ private object GetBinding(View view)
+ {
+ return null;
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayouter Initialize.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayouter.Initialize M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayouterInitialize()
+ {
+ tlog.Debug(tag, $"LinearLayouterInitialize 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 linearLayouter = new LinearLayouter();
+ Assert.IsNotNull(linearLayouter, "Should not be null");
+
+ linearLayouter.Initialize(view);
+
+ linearLayouter.Padding = new Extents(0, 0, 0, 0);
+
+ view.Dispose();
+ linearLayouter.Dispose();
+
+ tlog.Debug(tag, $"LinearLayouterInitialize END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayouter RequestLayout.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayouter.RequestLayout M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayouterRequestLayout()
+ {
+ tlog.Debug(tag, $"LinearLayouterRequestLayout 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 linearLayouter = new LinearLayouter();
+ Assert.IsNotNull(linearLayouter, "Should not be null");
+
+ linearLayouter.Initialize(view);
+
+ linearLayouter.RequestLayout(5.0f);
+
+ linearLayouter.RequestLayout(150.0f, true);
+
+ view.Dispose();
+ linearLayouter.Dispose();
+
+ tlog.Debug(tag, $"LinearLayouterRequestLayout END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayouter Clear.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayouter.Clear M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayouterClear()
+ {
+ tlog.Debug(tag, $"LinearLayouterClear START");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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 linearLayouter = new LinearLayouter();
+ Assert.IsNotNull(linearLayouter, "Should not be null");
+
+ linearLayouter.Initialize(view);
+ linearLayouter.RequestLayout(100.0f);
+ linearLayouter.Clear();
+
+ view.Dispose();
+ linearLayouter.Dispose();
+
+ tlog.Debug(tag, $"LinearLayouterClear END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayouter NotifyItemSizeChanged.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayouter.NotifyItemSizeChanged M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayouterNotifyItemSizeChanged()
+ {
+ tlog.Debug(tag, $"LinearLayouterNotifyItemSizeChanged");
+
+ var view = new CollectionView(new List<string>() { "123" })
+ {
+ Header = new RecyclerViewItem(),
+ IsGrouped = false,
+ };
+ Assert.IsNotNull(view, "Should not be null");
+
+ view.GroupHeaderTemplate = new DataTemplate(typeof(RecyclerViewItem));
+ view.ItemTemplate = new DataTemplate(typeof(RecyclerViewItem));
+
+ var emptySource = new CustomEmptySource();
+
+ var linearLayouter = new LinearLayouter();
+ Assert.IsNotNull(linearLayouter, "Should not be null");
+
+ linearLayouter.Initialize(view);
+
+ var item = new RecyclerViewItem()
+ {
+ Size = new Size(200, 100),
+ };
+ //linearLayouter.NotifyItemSizeChanged(item);
+ item.Dispose();
+
+ view.Dispose();
+ linearLayouter.Dispose();
+
+ tlog.Debug(tag, $"LinearLayouterNotifyItemSizeChanged END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayouter NotifyItemInserted.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayouter.NotifyItemInserted M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayouterNotifyItemInserted()
+ {
+ tlog.Debug(tag, $"LinearLayouterNotifyItemInserted");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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 linearLayouter = new LinearLayouter();
+ Assert.IsNotNull(linearLayouter, "Should not be null");
+
+ linearLayouter.Initialize(view);
+ linearLayouter.RequestLayout(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+ linearLayouter.NotifyItemInserted(source, 0);
+
+ source.Position = 4;
+ linearLayouter.NotifyItemInserted(source, 0);
+
+ linearLayouter.NotifyItemInserted(source, 1);
+
+ var emptySource = new CustomEmptySource();
+ linearLayouter.NotifyItemInserted(emptySource, 1);
+
+ view.Dispose();
+ linearLayouter.Dispose();
+
+ source.Dispose();
+ emptySource.Dispose();
+
+ tlog.Debug(tag, $"LinearLayouterNotifyItemInserted END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayouter NotifyItemRangeInserted.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayouter.NotifyItemRangeInserted M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayouterNotifyItemRangeInserted()
+ {
+ tlog.Debug(tag, $"LinearLayouterNotifyItemRangeInserted");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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 linearLayouter = new LinearLayouter();
+ Assert.IsNotNull(linearLayouter, "Should not be null");
+
+ linearLayouter.Initialize(view);
+ linearLayouter.RequestLayout(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ FooterIndex = 2,
+ };
+ linearLayouter.NotifyItemRangeInserted(source, 0, 3);
+
+ source.Position = 6;
+ linearLayouter.NotifyItemRangeInserted(source, 0, 1);
+
+ linearLayouter.NotifyItemRangeInserted(source, 1, 1);
+
+ view.Dispose();
+ linearLayouter.Dispose();
+
+ source.Dispose();
+
+ tlog.Debug(tag, $"LinearLayouterNotifyItemRangeInserted END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayouter NotifyItemRemoved.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayouter.NotifyItemRemoved M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayouterNotifyItemRemoved()
+ {
+ tlog.Debug(tag, $"LinearLayouterNotifyItemRemoved");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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 linearLayouter = new LinearLayouter();
+ Assert.IsNotNull(linearLayouter, "Should not be null");
+
+ linearLayouter.Initialize(view);
+ linearLayouter.RequestLayout(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+
+ linearLayouter.NotifyItemRangeInserted(source, 0, 1);
+ linearLayouter.NotifyItemRemoved(source, 0);
+
+ linearLayouter.NotifyItemRangeInserted(source, 0, 2);
+ linearLayouter.NotifyItemRemoved(source, 1);
+
+ var emptySource = new CustomEmptySource();
+ linearLayouter.NotifyItemInserted(emptySource, 1);
+ linearLayouter.NotifyItemRemoved(emptySource, 1);
+
+ view.Dispose();
+ linearLayouter.Dispose();
+
+ source.Dispose();
+ emptySource.Dispose();
+
+ tlog.Debug(tag, $"LinearLayouterNotifyItemRemoved END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayouter NotifyItemRangeRemoved.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayouter.NotifyItemRangeRemoved M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayouterNotifyItemRangeRemoved()
+ {
+ tlog.Debug(tag, $"LinearLayouterNotifyItemRangeRemoved");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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 linearLayouter = new LinearLayouter();
+ Assert.IsNotNull(linearLayouter, "Should not be null");
+
+ linearLayouter.Initialize(view);
+ linearLayouter.RequestLayout(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+
+ linearLayouter.NotifyItemRangeInserted(source, 0, 1);
+ linearLayouter.NotifyItemRangeRemoved(source, 0, 1);
+
+ view.Dispose();
+ linearLayouter.Dispose();
+
+ source.Dispose();
+
+ tlog.Debug(tag, $"LinearLayouterNotifyItemRangeRemoved END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayouter NotifyItemMoved.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayouter.NotifyItemMoved M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayouterNotifyItemMoved()
+ {
+ tlog.Debug(tag, $"LinearLayouterNotifyItemMoved");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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 linearLayouter = new LinearLayouter();
+ Assert.IsNotNull(linearLayouter, "Should not be null");
+
+ linearLayouter.Initialize(view);
+ linearLayouter.RequestLayout(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+
+ linearLayouter.NotifyItemRangeInserted(source, 0, 10);
+ linearLayouter.NotifyItemMoved(source, 1, 22);
+
+ view.Dispose();
+ linearLayouter.Dispose();
+
+ source.Dispose();
+
+ tlog.Debug(tag, $"LinearLayouterNotifyItemMoved END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayouter NotifyItemRangeMoved.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayouter.NotifyItemRangeMoved M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayouterNotifyItemRangeMoved()
+ {
+ tlog.Debug(tag, $"LinearLayouterNotifyItemRangeMoved");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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 linearLayouter = new LinearLayouter();
+ Assert.IsNotNull(linearLayouter, "Should not be null");
+
+ linearLayouter.Initialize(view);
+ linearLayouter.RequestLayout(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+
+ var orientationSize = linearLayouter.CalculateLayoutOrientationSize();
+ Assert.AreEqual(orientationSize, 6);
+
+ var scrollPosition = linearLayouter.CalculateCandidateScrollPosition(0.0f);
+ Assert.AreEqual(scrollPosition, 0.0f);
+
+ linearLayouter.NotifyItemRangeInserted(source, 0, 10);
+ linearLayouter.NotifyItemRangeMoved(source, 11, 16, 5);
+
+ view.Dispose();
+ linearLayouter.Dispose();
+
+ source.Dispose();
+
+ tlog.Debug(tag, $"LinearLayouterNotifyItemRangeMoved END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("LinearLayouter RequestNextFocusableView.")]
+ [Property("SPEC", "Tizen.NUI.Components.LinearLayouter.RequestNextFocusableView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "xiaohui.fang@samsung.com")]
+ public void LinearLayouterRequestNextFocusableView()
+ {
+ tlog.Debug(tag, $"LinearLayouterRequestNextFocusableView");
+
+ var view = new CollectionView(new List<string>() { "123", "456" })
+ {
+ 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 linearLayouter = new LinearLayouter();
+ Assert.IsNotNull(linearLayouter, "Should not be null");
+
+ linearLayouter.Initialize(view);
+ linearLayouter.RequestLayout(100.0f);
+
+ var source = new CustomGroupItemSource(view)
+ {
+ Position = 1,
+ };
+
+ var orientationSize = linearLayouter.CalculateLayoutOrientationSize();
+ Assert.AreEqual(orientationSize, 6);
+
+ var scrollPosition = linearLayouter.CalculateCandidateScrollPosition(0.0f);
+ Assert.AreEqual(scrollPosition, 0.0f);
+
+ linearLayouter.NotifyItemRangeInserted(source, 0, 10);
+
+ linearLayouter.RequestNextFocusableView(view, View.FocusDirection.Up, true);
+ linearLayouter.RequestNextFocusableView(view, View.FocusDirection.Down, true);
+ linearLayouter.RequestNextFocusableView(view, View.FocusDirection.PageUp, true);
+ linearLayouter.RequestNextFocusableView(view, View.FocusDirection.PageDown, true);
+ linearLayouter.RequestNextFocusableView(view, View.FocusDirection.Left, true);
+ linearLayouter.RequestNextFocusableView(view, View.FocusDirection.Right, true);
+
+ view.Dispose();
+ linearLayouter.Dispose();
+
+ source.Dispose();
+
+ tlog.Debug(tag, $"LinearLayouterRequestNextFocusableView 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 System.Threading.Tasks;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.Components.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("Controls/RecyclerView/ItemSource/CollectionView")]
+ class TSCollectionView
+ {
+ private const string tag = "NUITEST";
+
+ 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;
+
+ [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("CollectionView constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewConstructor()
+ {
+ tlog.Debug(tag, $"CollectionViewConstructor START");
+
+ var testingTarget = new CollectionView();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewConstructor END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewConstructorWithItemsSource()
+ {
+ tlog.Debug(tag, $"CollectionViewConstructorWithItemsSource START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewConstructorWithItemsSource END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView constructor.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewConstructorWithItemsSourceLayouterTemplate()
+ {
+ tlog.Debug(tag, $"CollectionViewConstructorWithItemsSourceLayouterTemplate START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model, new LinearLayouter(), testDataTemplate);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewConstructorWithItemsSourceLayouterTemplate END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView ItemsSource.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.ItemsSource A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewItemsSource()
+ {
+ tlog.Debug(tag, $"CollectionViewItemsSource START");
+
+ var testingTarget = new CollectionView();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.ItemsSource = new TestModel();
+ Assert.IsNotNull(testingTarget.ItemsSource, "should be not null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewItemsSource END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView ItemTemplate.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.ItemTemplate A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewItemTemplate()
+ {
+ tlog.Debug(tag, $"CollectionViewItemTemplate START");
+
+ var testingTarget = new CollectionView();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.ItemTemplate = testDataTemplate;
+ Assert.IsNotNull(testingTarget.ItemTemplate, "should be not null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewItemTemplate END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("CollectionView ItemTemplate.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.ItemTemplate A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewItemTemplateNull()
+ {
+ tlog.Debug(tag, $"CollectionViewItemTemplateNull START");
+
+ var testingTarget = new CollectionView();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.ItemTemplate = null;
+ Assert.IsNull(testingTarget.ItemTemplate, "should be null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewItemTemplateNull END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView ItemsLayouter.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.ItemsLayouter A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewItemsLayouter()
+ {
+ tlog.Debug(tag, $"CollectionViewItemsLayouter START");
+
+ var testingTarget = new CollectionView();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.ItemsLayouter = new LinearLayouter();
+ Assert.IsNotNull(testingTarget.ItemsLayouter, "should not be null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewItemsLayouter END (OK)");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("CollectionView ItemsLayouter.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.ItemsLayouter A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewItemsLayouterNull()
+ {
+ tlog.Debug(tag, $"CollectionViewItemsLayouterNull START");
+
+ var testingTarget = new CollectionView();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.ItemsLayouter = null;
+ Assert.IsNull(testingTarget.ItemsLayouter, "should be null");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewItemsLayouterNull END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView ScrollingDirection.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.ScrollingDirection A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewScrollingDirection()
+ {
+ tlog.Debug(tag, $"CollectionViewScrollingDirection START");
+
+ var testingTarget = new CollectionView();
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.ScrollingDirection = ScrollableBase.Direction.Horizontal;
+ Assert.AreEqual(testingTarget.ScrollingDirection, ScrollableBase.Direction.Horizontal, "should be horizontal");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewScrollingDirection END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView SelectedItem.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.SelectedItem A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewSelectedItem()
+ {
+ tlog.Debug(tag, $"CollectionViewSelectedItem START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.SelectedItem = "Cat";
+ Assert.AreEqual(testingTarget.SelectedItem, "Cat", "Some items should be selected");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewSelectedItem END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView SelectedItems.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.SelectedItems A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewSelectedItems()
+ {
+ tlog.Debug(tag, $"CollectionViewSelectedItems START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ tlog.Debug(tag, "SelectedItems : " + testingTarget.SelectedItems);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewSelectedItems END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView SelectionMode.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.SelectionMode A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewSelectionMode()
+ {
+ tlog.Debug(tag, $"CollectionViewSelectionMode START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.SelectionMode = ItemSelectionMode.None;
+ Assert.AreEqual(testingTarget.SelectionMode, ItemSelectionMode.None, "Selection mode is none.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewSelectionMode END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView SelectionChangedCommand.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.SelectionChangedCommand A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewSelectionChangedCommand()
+ {
+ tlog.Debug(tag, $"CollectionViewSelectionChangedCommand START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.SelectionChangedCommand = null;
+ Assert.IsNull(testingTarget.SelectionChangedCommand, "Selection change command is null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewSelectionChangedCommand END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView SelectionChangedCommandParameter.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.SelectionChangedCommandParameter A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewSelectionChangedCommandParameter()
+ {
+ tlog.Debug(tag, $"CollectionViewSelectionChangedCommandParameter START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.SelectionChangedCommandParameter = null;
+ Assert.IsNull(testingTarget.SelectionChangedCommandParameter, "Selection change command parameter is null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewSelectionChangedCommandParameter END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView Header.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.Header A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewHeader()
+ {
+ tlog.Debug(tag, $"CollectionViewHeader START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ DefaultTitleItem myTitle = new DefaultTitleItem();
+ myTitle.Text = "test";
+ testingTarget.Header = myTitle;
+ Assert.IsNotNull(testingTarget.Header, "should be header.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewHeader END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView Footer.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.Footer A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewFooter()
+ {
+ tlog.Debug(tag, $"CollectionViewFooter START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ DefaultTitleItem myTitle = new DefaultTitleItem();
+ myTitle.Text = "test";
+ testingTarget.Footer = myTitle;
+ Assert.IsNotNull(testingTarget.Footer, "should be footer.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewFooter END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView IsGrouped.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.IsGrouped A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewIsGrouped()
+ {
+ tlog.Debug(tag, $"CollectionViewIsGrouped START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.IsGrouped = true;
+ Assert.IsTrue(testingTarget.IsGrouped, "should be grouped.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewIsGrouped END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView GroupHeaderTemplate.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.GroupHeaderTemplate A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewGroupHeaderTemplate()
+ {
+ tlog.Debug(tag, $"CollectionViewGroupHeaderTemplate START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.GroupHeaderTemplate = testDataTemplate;
+ Assert.IsNotNull(testingTarget.GroupHeaderTemplate, "should not be null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewGroupHeaderTemplate END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView GroupFooterTemplate.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.GroupFooterTemplate A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewGroupFooterTemplate()
+ {
+ tlog.Debug(tag, $"CollectionViewGroupFooterTemplate START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.GroupFooterTemplate = testDataTemplate;
+ Assert.IsNotNull(testingTarget.GroupFooterTemplate, "should not be null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewGroupFooterTemplate END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView InternalItemSource.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.InternalItemSource A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewInternalItemSource()
+ {
+ tlog.Debug(tag, $"CollectionViewInternalItemSource START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.InternalItemSource = null;
+ Assert.IsNull(testingTarget.InternalItemSource, "should be null.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewInternalItemSource END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView SizingStrategy.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.SizingStrategy A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewSizingStrategy()
+ {
+ tlog.Debug(tag, $"CollectionViewSizingStrategy START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.SizingStrategy = ItemSizingStrategy.MeasureFirst;
+ Assert.AreEqual(testingTarget.SizingStrategy, ItemSizingStrategy.MeasureFirst, "should be equal.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewSizingStrategy END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView UpdateSelectedItems.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.UpdateSelectedItems M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewUpdateSelectedItems()
+ {
+ tlog.Debug(tag, $"CollectionViewUpdateSelectedItems START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ try
+ {
+ testingTarget.UpdateSelectedItems(null);
+ }
+ catch (ArgumentNullException)
+ {
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewUpdateSelectedItems END (OK)");
+ Assert.Pass("Caught ArgumentNullException : Passed!");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView ScrollTo.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.ScrollTo M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewUpdateScrollTo()
+ {
+ tlog.Debug(tag, $"CollectionViewUpdateScrollTo START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model, new LinearLayouter(), testDataTemplate);
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.ScrollTo(123.0f, false);
+ tlog.Debug(tag, "SelectedItems : " + testingTarget.SelectedItems);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewUpdateScrollTo END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView ScrollToIndex.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.ScrollToIndex M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public void CollectionViewScrollToIndex()
+ {
+ tlog.Debug(tag, $"CollectionViewScrollToIndex START");
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model, new LinearLayouter(), testDataTemplate);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ testingTarget.ScrollToIndex(5);
+ tlog.Debug(tag, "SelectedItems : " + testingTarget.SelectedItems);
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"CollectionViewScrollToIndex END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("CollectionView GetNextFocusableView.")]
+ [Property("SPEC", "Tizen.NUI.Components.CollectionView.GetNextFocusableView M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "")]
+ [Property("AUTHOR", "huayong.xu@samsung.com")]
+ public async Task CollectionViewGetNextFocusableView()
+ {
+ tlog.Debug(tag, $"CollectionViewGetNextFocusableView START");
+
+ TaskCompletionSource<bool> tcs = new TaskCompletionSource<bool>(false);
+ EventHandler onAddedToWindow = (s, e) => { tcs.TrySetResult(true); };
+
+ var model = new TestModel();
+ var testingTarget = new CollectionView(model, new LinearLayouter(), testDataTemplate);
+ testingTarget.AddedToWindow += onAddedToWindow;
+ testingTarget.Size = new Size(100, 100);
+
+ Assert.IsNotNull(testingTarget, "should be not null");
+ Assert.IsInstanceOf<CollectionView>(testingTarget, "should be an instance of testing target class!");
+
+ Window.Instance.Add(testingTarget);
+ var result = await tcs.Task;
+ Assert.IsTrue(result, "Relayout event should be invoked");
+
+ testingTarget.GetNextFocusableView(null, View.FocusDirection.Down, false);
+ tlog.Debug(tag, "SelectedItems : " + testingTarget.SelectedItems);
+
+ if (testingTarget != null)
+ {
+ Window.Instance.Remove(testingTarget);
+ testingTarget.Dispose();
+ testingTarget = null;
+ }
+ tlog.Debug(tag, $"CollectionViewGetNextFocusableView END (OK)");
+ }
+ }
+}