[NUI][TCSACR-469] Add TCT for Page.Appear/Disappear events 80/265880/5
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Mon, 1 Nov 2021 07:55:33 +0000 (16:55 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 23 Nov 2021 03:46:40 +0000 (12:46 +0900)
TCT patch for https://code.sec.samsung.net/jira/browse/TCSACR-469
TCT is added for new events Page.Appearing, Page.Disappearing,
Page.Appeared, and Page.Disappeared.

Change-Id: I98f3f27d249c9651375c4b872da78a55f2255bef

tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPage.cs
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageAppearedEventArgs.cs [new file with mode: 0755]
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageAppearingEventArgs.cs [new file with mode: 0755]
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageDisappearedEventArgs.cs [new file with mode: 0755]
tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageDisappearingEventArgs.cs [new file with mode: 0755]

index e974626..b389c06 100755 (executable)
@@ -71,6 +71,176 @@ namespace Tizen.NUI.Components.Tests
             Assert.AreSame(navigator, page.Navigator, "Retrieved Navigator should be the same with the navigator which pushes the page.");
         }
 
+        [Test]
+        [Category("P1")]
+        [Description("Test Appearing event. Check if Appearing event is callable.")]
+        [Property("SPEC", "Tizen.NUI.Components.Page.Appearing E")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "EVL")]
+        [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+        public void Appearing_CHECK_EVENT()
+        {
+            /* PRECONDITION */
+            bool isCalled = false;
+
+            var navigator = new Navigator();
+            Assert.IsNotNull(navigator, "Can't create success object Navigator");
+            Assert.IsInstanceOf<Navigator>(navigator, "Construct Navigator Fail");
+
+            var page = new MyPage();
+            Assert.IsNotNull(page, "Can't create success object Page");
+            Assert.IsInstanceOf<Page>(page, "Construct Page Fail");
+            navigator.Push(page);
+
+            page = new MyPage();
+            Assert.IsNotNull(page, "Can't create success object Page");
+            Assert.IsInstanceOf<Page>(page, "Construct Page Fail");
+
+            EventHandler<PageAppearingEventArgs> appearing = (sender, args) =>
+            {
+                isCalled = true;
+            };
+
+            page.Appearing += appearing;
+
+            /* TEST CODE */
+            navigator.Push(page);
+            Assert.AreEqual(true, isCalled, "Appearing event should be called when page is started appearing by pushing the page");
+
+            page.Appearing -= appearing;
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Disappearing event. Check if Disappearing event is callable.")]
+        [Property("SPEC", "Tizen.NUI.Components.Page.Disappearing E")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "EVL")]
+        [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+        public async Task Disappearing_CHECK_EVENT()
+        {
+            /* PRECONDITION */
+            bool isCalled = false;
+
+            var navigator = new Navigator();
+            Assert.IsNotNull(navigator, "Can't create success object Navigator");
+            Assert.IsInstanceOf<Navigator>(navigator, "Construct Navigator Fail");
+
+            var page = new MyPage();
+            Assert.IsNotNull(page, "Can't create success object Page");
+            Assert.IsInstanceOf<Page>(page, "Construct Page Fail");
+            navigator.Push(page);
+
+            page = new MyPage();
+            Assert.IsNotNull(page, "Can't create success object Page");
+            Assert.IsInstanceOf<Page>(page, "Construct Page Fail");
+
+            EventHandler<PageDisappearingEventArgs> disappearing = (sender, args) =>
+            {
+                isCalled = true;
+            };
+
+            page.Disappearing += disappearing;
+
+            /* TEST CODE */
+            navigator.Push(page);
+
+            await Task.Delay(2000);
+
+            navigator.Pop();
+            Assert.AreEqual(true, isCalled, "Disappearing event should be called when page is started disappearing by popping the page");
+
+            page.Disappearing -= disappearing;
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Appeared event. Check if Appeared event is callable.")]
+        [Property("SPEC", "Tizen.NUI.Components.Page.Appeared E")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "EVL")]
+        [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+        public async Task Appeared_CHECK_EVENT()
+        {
+            /* PRECONDITION */
+            bool isCalled = false;
+
+            var navigator = new Navigator();
+            Assert.IsNotNull(navigator, "Can't create success object Navigator");
+            Assert.IsInstanceOf<Navigator>(navigator, "Construct Navigator Fail");
+
+            var page = new MyPage();
+            Assert.IsNotNull(page, "Can't create success object Page");
+            Assert.IsInstanceOf<Page>(page, "Construct Page Fail");
+            navigator.Push(page);
+
+            page = new MyPage();
+            Assert.IsNotNull(page, "Can't create success object Page");
+            Assert.IsInstanceOf<Page>(page, "Construct Page Fail");
+
+            EventHandler<PageAppearedEventArgs> appeared = (sender, args) =>
+            {
+                isCalled = true;
+            };
+
+            page.Appeared += appeared;
+
+            /* TEST CODE */
+            navigator.Push(page);
+
+            await Task.Delay(2000);
+
+            Assert.AreEqual(true, isCalled, "Appearing event should be called when page is finished appearing by pushing the page");
+
+            page.Appeared -= appeared;
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Disappeared event. Check if Disappeared event is callable.")]
+        [Property("SPEC", "Tizen.NUI.Components.Page.Disappeared E")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "EVL")]
+        [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]
+        public async Task Disappeared_CHECK_EVENT()
+        {
+            /* PRECONDITION */
+            bool isCalled = false;
+
+            var navigator = new Navigator();
+            Assert.IsNotNull(navigator, "Can't create success object Navigator");
+            Assert.IsInstanceOf<Navigator>(navigator, "Construct Navigator Fail");
+
+            var page = new MyPage();
+            Assert.IsNotNull(page, "Can't create success object Page");
+            Assert.IsInstanceOf<Page>(page, "Construct Page Fail");
+            navigator.Push(page);
+
+            page = new MyPage();
+            Assert.IsNotNull(page, "Can't create success object Page");
+            Assert.IsInstanceOf<Page>(page, "Construct Page Fail");
+
+            EventHandler<PageDisappearedEventArgs> disappeared = (sender, args) =>
+            {
+                isCalled = true;
+            };
+
+            page.Disappeared += disappeared;
+
+            /* TEST CODE */
+            navigator.Push(page);
+
+            await Task.Delay(2000);
+
+            navigator.Pop();
+
+            await Task.Delay(2000);
+
+            Assert.AreEqual(true, isCalled, "Disappearing event should be called when page is finished disappearing by popping the page");
+
+            page.Disappeared -= disappeared;
+        }
+
         public class MyPage : Page
         {
         }
diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageAppearedEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageAppearedEventArgs.cs
new file mode 100755 (executable)
index 0000000..06e2668
--- /dev/null
@@ -0,0 +1,47 @@
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+using System;\r
+using Tizen.NUI;\r
+using Tizen.NUI.Components;\r
+using System.Runtime.InteropServices;\r
+using System.Threading.Tasks;\r
+using Tizen.NUI.Components.Test;\r
+\r
+namespace Tizen.NUI.Components.Tests\r
+{\r
+    [TestFixture]\r
+    [Description("Tizen.NUI.Components.PageAppearedEventArgs Tests")]\r
+    public class PageAppearedEventArgsTests\r
+    {\r
+        private const string TAG = "Components";\r
+\r
+        [SetUp]\r
+        public void Init()\r
+        {\r
+            Tizen.Log.Info(TAG, "Init() is called!");\r
+        }\r
+\r
+        [TearDown]\r
+        public void Destroy()\r
+        {\r
+            Tizen.Log.Info(TAG, "Destroy() is called!");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Test PageAppearedEventArgs empty constructor. Check it has been triggered")]\r
+        [Property("SPEC", "Tizen.NUI.Components.PageAppearedEventArgs.PageAppearedEventArgs C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTR")]\r
+        [Property("COVPARAM", "")]\r
+        [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]\r
+        public void PageAppearedEventArgs_CHECK_VALUE()\r
+        {\r
+            /* TEST CODE */\r
+            var pageAppearedEventArgs = new PageAppearedEventArgs();\r
+            Assert.IsNotNull(pageAppearedEventArgs, "Should be not null!");\r
+            Assert.IsInstanceOf<PageAppearedEventArgs>(pageAppearedEventArgs, "Should be equal!");\r
+\r
+        }\r
+    }\r
+}\r
diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageAppearingEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageAppearingEventArgs.cs
new file mode 100755 (executable)
index 0000000..4da752a
--- /dev/null
@@ -0,0 +1,47 @@
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+using System;\r
+using Tizen.NUI;\r
+using Tizen.NUI.Components;\r
+using System.Runtime.InteropServices;\r
+using System.Threading.Tasks;\r
+using Tizen.NUI.Components.Test;\r
+\r
+namespace Tizen.NUI.Components.Tests\r
+{\r
+    [TestFixture]\r
+    [Description("Tizen.NUI.Components.PageAppearingEventArgs Tests")]\r
+    public class PageAppearingEventArgsTests\r
+    {\r
+        private const string TAG = "Components";\r
+\r
+        [SetUp]\r
+        public void Init()\r
+        {\r
+            Tizen.Log.Info(TAG, "Init() is called!");\r
+        }\r
+\r
+        [TearDown]\r
+        public void Destroy()\r
+        {\r
+            Tizen.Log.Info(TAG, "Destroy() is called!");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Test PageAppearingEventArgs empty constructor. Check it has been triggered")]\r
+        [Property("SPEC", "Tizen.NUI.Components.PageAppearingEventArgs.PageAppearingEventArgs C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTR")]\r
+        [Property("COVPARAM", "")]\r
+        [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]\r
+        public void PageAppearingEventArgs_CHECK_VALUE()\r
+        {\r
+            /* TEST CODE */\r
+            var pageAppearingEventArgs = new PageAppearingEventArgs();\r
+            Assert.IsNotNull(pageAppearingEventArgs, "Should be not null!");\r
+            Assert.IsInstanceOf<PageAppearingEventArgs>(pageAppearingEventArgs, "Should be equal!");\r
+\r
+        }\r
+    }\r
+}\r
diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageDisappearedEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageDisappearedEventArgs.cs
new file mode 100755 (executable)
index 0000000..b927b13
--- /dev/null
@@ -0,0 +1,47 @@
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+using System;\r
+using Tizen.NUI;\r
+using Tizen.NUI.Components;\r
+using System.Runtime.InteropServices;\r
+using System.Threading.Tasks;\r
+using Tizen.NUI.Components.Test;\r
+\r
+namespace Tizen.NUI.Components.Tests\r
+{\r
+    [TestFixture]\r
+    [Description("Tizen.NUI.Components.PageDisappearedEventArgs Tests")]\r
+    public class PageDisappearedEventArgsTests\r
+    {\r
+        private const string TAG = "Components";\r
+\r
+        [SetUp]\r
+        public void Init()\r
+        {\r
+            Tizen.Log.Info(TAG, "Init() is called!");\r
+        }\r
+\r
+        [TearDown]\r
+        public void Destroy()\r
+        {\r
+            Tizen.Log.Info(TAG, "Destroy() is called!");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Test PageDisappearedEventArgs empty constructor. Check it has been triggered")]\r
+        [Property("SPEC", "Tizen.NUI.Components.PageDisappearedEventArgs.PageDisappearedEventArgs C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTR")]\r
+        [Property("COVPARAM", "")]\r
+        [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]\r
+        public void PageDisappearedEventArgs_CHECK_VALUE()\r
+        {\r
+            /* TEST CODE */\r
+            var pageDisappearedEventArgs = new PageDisappearedEventArgs();\r
+            Assert.IsNotNull(pageDisappearedEventArgs, "Should be not null!");\r
+            Assert.IsInstanceOf<PageDisappearedEventArgs>(pageDisappearedEventArgs, "Should be equal!");\r
+\r
+        }\r
+    }\r
+}\r
diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageDisappearingEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPageDisappearingEventArgs.cs
new file mode 100755 (executable)
index 0000000..42e8965
--- /dev/null
@@ -0,0 +1,47 @@
+using NUnit.Framework;\r
+using NUnit.Framework.TUnit;\r
+using System;\r
+using Tizen.NUI;\r
+using Tizen.NUI.Components;\r
+using System.Runtime.InteropServices;\r
+using System.Threading.Tasks;\r
+using Tizen.NUI.Components.Test;\r
+\r
+namespace Tizen.NUI.Components.Tests\r
+{\r
+    [TestFixture]\r
+    [Description("Tizen.NUI.Components.PageDisappearingEventArgs Tests")]\r
+    public class PageDisappearingEventArgsTests\r
+    {\r
+        private const string TAG = "Components";\r
+\r
+        [SetUp]\r
+        public void Init()\r
+        {\r
+            Tizen.Log.Info(TAG, "Init() is called!");\r
+        }\r
+\r
+        [TearDown]\r
+        public void Destroy()\r
+        {\r
+            Tizen.Log.Info(TAG, "Destroy() is called!");\r
+        }\r
+\r
+        [Test]\r
+        [Category("P1")]\r
+        [Description("Test PageDisappearingEventArgs empty constructor. Check it has been triggered")]\r
+        [Property("SPEC", "Tizen.NUI.Components.PageDisappearingEventArgs.PageDisappearingEventArgs C")]\r
+        [Property("SPEC_URL", "-")]\r
+        [Property("CRITERIA", "CONSTR")]\r
+        [Property("COVPARAM", "")]\r
+        [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")]\r
+        public void PageDisappearingEventArgs_CHECK_VALUE()\r
+        {\r
+            /* TEST CODE */\r
+            var pageDisappearingEventArgs = new PageDisappearingEventArgs();\r
+            Assert.IsNotNull(pageDisappearingEventArgs, "Should be not null!");\r
+            Assert.IsInstanceOf<PageDisappearingEventArgs>(pageDisappearingEventArgs, "Should be equal!");\r
+\r
+        }\r
+    }\r
+}\r