From 810f2b78a5f336810fd7c74a32b5a7cde5468d7c Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Mon, 1 Nov 2021 17:17:01 +0900 Subject: [PATCH] [NUI][TCSACR-470] Add TCT for Navigator.Popped event TCT patch for https://code.sec.samsung.net/jira/browse/TCSACR-470 TCT is added for new event Navigator.Popped. Change-Id: Iee3e7e9c22654f3677f74b7f569a0cdc301bacfe --- .../testcase/TSNavigator.cs | 48 ++++++++++++++++++++++ .../testcase/TSPoppedEventArgs.cs | 47 +++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100755 tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPoppedEventArgs.cs diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSNavigator.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSNavigator.cs index 5c6e5f5..40975e3 100755 --- a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSNavigator.cs +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSNavigator.cs @@ -319,5 +319,53 @@ namespace Tizen.NUI.Components.Tests Assert.IsNotNull(navigator, "Can't create success object Navigator"); Assert.IsInstanceOf(navigator, "Costruct Navigator Fail"); } + + [Test] + [Category("P1")] + [Description("Test Popped event. Check if Popped event is callable.")] + [Property("SPEC", "Tizen.NUI.Components.Navigator.Popped E")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "EVL")] + [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")] + public async Task Popped_CHECK_EVENT() + { + /* TEST CODE */ + bool isCalled = false; + + var navigator = NUIApplication.GetDefaultWindow().GetDefaultNavigator(); + Assert.IsNotNull(navigator, "Can't create success object Navigator"); + Assert.IsInstanceOf(navigator, "Construct Navigator Fail"); + + var page = new ContentPage(); + Assert.IsNotNull(page, "Can't create success object ContentPage"); + Assert.IsInstanceOf(page, "Construct ContentPage Fail"); + navigator.Push(page); + + page = new ContentPage(); + Assert.IsNotNull(page, "Can't create success object ContentPage"); + Assert.IsInstanceOf(page, "Construct ContentPage Fail"); + + EventHandler popped = (sender, args) => + { + if (args.Page == page) + { + isCalled = true; + } + }; + navigator.Popped += popped; + + navigator.Push(page); + + await Task.Delay(2000); + + /* TEST CODE */ + navigator.Pop(); + + await Task.Delay(2000); + + Assert.AreEqual(true, isCalled, "Popped event should be called after popping is finished."); + + navigator.Popped -= popped; + } } } diff --git a/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPoppedEventArgs.cs b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPoppedEventArgs.cs new file mode 100755 index 0000000..c2afaad --- /dev/null +++ b/tct-suite-vs/Tizen.NUI.Components.Tests/testcase/TSPoppedEventArgs.cs @@ -0,0 +1,47 @@ +using NUnit.Framework; +using NUnit.Framework.TUnit; +using System; +using Tizen.NUI; +using Tizen.NUI.Components; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Tizen.NUI.Components.Test; + +namespace Tizen.NUI.Components.Tests +{ + [TestFixture] + [Description("Tizen.NUI.Components.PoppedEventArgs Tests")] + public class PoppedEventArgsTests + { + private const string TAG = "Components"; + + [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("Test PoppedEventArgs empty constructor. Check it has been triggered")] + [Property("SPEC", "Tizen.NUI.Components.PoppedEventArgs.PoppedEventArgs C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("COVPARAM", "")] + [Property("AUTHOR", "Jaehyun Cho, jae_hyun.cho@samsung.com")] + public void PoppedEventArgs_CHECK_VALUE() + { + /* TEST CODE */ + var poppedEventArgs = new PoppedEventArgs(); + Assert.IsNotNull(poppedEventArgs, "Should be not null!"); + Assert.IsInstanceOf(poppedEventArgs, "Should be equal!"); + + } + } +} -- 2.7.4