--- /dev/null
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using System;
+using System.Threading.Tasks;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Components.Test;
+
+namespace Tizen.NUI.Components.Tests
+{
+ [TestFixture]
+ [Description("Tizen.NUI.Components.Navigator Tests")]
+ public class NavigatorTests
+ {
+ private const string TAG = "Components";
+
+ public NavigatorTests()
+ {
+ }
+
+ ~NavigatorTests()
+ {
+ }
+
+ [SetUp]
+ public void Init()
+ {
+ Tizen.Log.Info(TAG, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ Tizen.Log.Info(TAG, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Create a Navigator object. Check whether Navigator is successfully created or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.Navigator C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void Navigator_INIT()
+ {
+ /* TEST CODE */
+ var navigator = new Navigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test PageCount. Check PageCount is readable.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.PageCount A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRO")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void PageCount_CHECK_GET_VALUE()
+ {
+ /* PRECONDITION */
+ var navigator = new Navigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ /* TEST CODE */
+ navigator.Push(page);
+ Assert.AreEqual(1, navigator.PageCount, "Retrieved PageCount should be equal to 1.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Push. Check Push works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.Push M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void Push_CHECK()
+ {
+ /* PRECONDITION */
+ var navigator = new Navigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ /* TEST CODE */
+ navigator.Push(page);
+ Assert.AreEqual(1, navigator.PageCount, "Retrieved PageCount should be equal to 1.");
+ Assert.AreSame(page, navigator.GetPage(0), "Retrieved Page should be the same with the pushed page.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Pop. Check Pop works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.Pop M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void Pop_CHECK_RETURN_VALUE()
+ {
+ /* PRECONDITION */
+ var navigator = new Navigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ navigator.Push(page);
+ Assert.AreEqual(1, navigator.PageCount, "Retrieved PageCount should be equal to 1.");
+ Assert.AreSame(page, navigator.GetPage(0), "Retrieved Page should be the same with the pushed page.");
+
+ /* TEST CODE */
+ var ret = navigator.Pop();
+ Assert.AreEqual(0, navigator.PageCount, "Retrieved PageCount should be equal to 0.");
+ Assert.AreSame(page, ret, "Retrieved Page should be the same with the pushed page.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetPage. Check GetPage works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.GetPage M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void GetPage_CHECK_RETURN_VALUE()
+ {
+ /* PRECONDITION */
+ var navigator = new Navigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ /* TEST CODE */
+ navigator.Push(page);
+ Assert.AreSame(page, navigator.GetPage(0), "Retrieved Page should be the same with the pushed page.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test IndexOf. Check IndexOf works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.IndexOf M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void IndexOf_CHECK_RETURN_VALUE()
+ {
+ /* PRECONDITION */
+ var navigator = new Navigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ /* TEST CODE */
+ navigator.Push(page);
+ Assert.AreEqual(0, navigator.IndexOf(page), "Retrieved IndexOf should be equal to 0.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Insert. Check Insert works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.Insert M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void Insert_CHECK()
+ {
+ /* PRECONDITION */
+ var navigator = new Navigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ /* TEST CODE */
+ navigator.Insert(0, page);
+ Assert.AreEqual(1, navigator.PageCount, "Retrieved PageCount should be equal to 1.");
+ Assert.AreSame(page, navigator.GetPage(0), "Retrieved Page should be the same with the inserted page.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test InsertBefore. Check InsertBefore works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.InsertBefore M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void InsertBefore_CHECK()
+ {
+ /* PRECONDITION */
+ var navigator = new Navigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ navigator.Push(page);
+ Assert.AreEqual(1, navigator.PageCount, "Retrieved PageCount should be equal to 1.");
+ Assert.AreSame(page, navigator.GetPage(0), "Retrieved Page should be the same with the pushed page.");
+
+ var page2 = new ContentPage();
+ Assert.IsNotNull(page2, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page2, "Costruct ContentPage Fail");
+
+ /* TEST CODE */
+ navigator.InsertBefore(page, page2);
+ Assert.AreEqual(2, navigator.PageCount, "Retrieved PageCount should be equal to 2.");
+ Assert.AreSame(page2, navigator.GetPage(0), "Retrieved Page should be the same with the inserted page.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Remove. Check Remove works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.Remove M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void Remove_CHECK()
+ {
+ /* PRECONDITION */
+ var navigator = new Navigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ navigator.Push(page);
+ Assert.AreEqual(1, navigator.PageCount, "Retrieved PageCount should be equal to 1.");
+ Assert.AreSame(page, navigator.GetPage(0), "Retrieved Page should be the same with the pushed page.");
+
+ /* TEST CODE */
+ navigator.Remove(page);
+ Assert.AreEqual(0, navigator.PageCount, "Retrieved PageCount should be equal to 0.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test RemoveAt. Check RemoveAt works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.RemoveAt M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void RemoveAt_CHECK()
+ {
+ /* PRECONDITION */
+ var navigator = new Navigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ navigator.Push(page);
+ Assert.AreEqual(1, navigator.PageCount, "Retrieved PageCount should be equal to 1.");
+ Assert.AreSame(page, navigator.GetPage(0), "Retrieved Page should be the same with the pushed page.");
+
+ /* TEST CODE */
+ navigator.RemoveAt(0);
+ Assert.AreEqual(0, navigator.PageCount, "Retrieved PageCount should be equal to 0.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Peek. Check Peek works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.Peek M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void Peek_CHECK_RETURN_VALUE()
+ {
+ /* PRECONDITION */
+ var navigator = new Navigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+
+ var page = new ContentPage();
+ Assert.IsNotNull(page, "Can't create success object ContentPage");
+ Assert.IsInstanceOf<ContentPage>(page, "Costruct ContentPage Fail");
+
+ navigator.Push(page);
+ Assert.AreEqual(1, navigator.PageCount, "Retrieved PageCount should be equal to 1.");
+ Assert.AreSame(page, navigator.GetPage(0), "Retrieved Page should be the same with the pushed page.");
+
+ /* TEST CODE */
+ Assert.AreSame(page, navigator.Peek(), "Retrieved Page should be the same with the pushed page.");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test GetDefaultNavigator. Check GetDefaultNavigator works or not.")]
+ [Property("SPEC", "Tizen.NUI.Components.Navigator.GetDefaultNavigator M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+ public void GetDefaultNavigator_CHECK_RETURN_VALUE()
+ {
+ /* TEST CODE */
+ var navigator = NUIApplication.GetDefaultWindow().GetDefaultNavigator();
+ Assert.IsNotNull(navigator, "Can't create success object Navigator");
+ Assert.IsInstanceOf<Navigator>(navigator, "Costruct Navigator Fail");
+ }
+ }
+}