From 500555cefce9ec62a4b3c520a441b2ea4bb0837a Mon Sep 17 00:00:00 2001 From: hyunho Date: Thu, 26 Sep 2019 16:46:41 +0900 Subject: [PATCH] [ComponentBased.Default][TCSACR-282] Add Release method TC Change-Id: I6a9742fabdd4df3134cd761b2272d9c6d0e27fa3 Signed-off-by: hyunho --- .../testcase/TSEFLComponentBasedApplication.cs | 10 ++++ .../testcase/TSEFLWindowInfo.cs | 69 ++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/tct-suite-vs/Tizen.ComponentBased.Default.Tests/testcase/TSEFLComponentBasedApplication.cs b/tct-suite-vs/Tizen.ComponentBased.Default.Tests/testcase/TSEFLComponentBasedApplication.cs index c0a4a78..5e9fe93 100644 --- a/tct-suite-vs/Tizen.ComponentBased.Default.Tests/testcase/TSEFLComponentBasedApplication.cs +++ b/tct-suite-vs/Tizen.ComponentBased.Default.Tests/testcase/TSEFLComponentBasedApplication.cs @@ -39,6 +39,16 @@ namespace Tizen.ComponentBased.Tests return 1; } } + + int IWindowInfo.ResourceId => throw new NotImplementedException(); + + public void Release() + { + } + + void IDisposable.Dispose() + { + } } public override IWindowInfo CreateWindowInfo() diff --git a/tct-suite-vs/Tizen.ComponentBased.Default.Tests/testcase/TSEFLWindowInfo.cs b/tct-suite-vs/Tizen.ComponentBased.Default.Tests/testcase/TSEFLWindowInfo.cs index 1e8f4e6..3aa19c0 100644 --- a/tct-suite-vs/Tizen.ComponentBased.Default.Tests/testcase/TSEFLWindowInfo.cs +++ b/tct-suite-vs/Tizen.ComponentBased.Default.Tests/testcase/TSEFLWindowInfo.cs @@ -28,6 +28,21 @@ using Tizen.Applications.ComponentBased.Default; namespace Tizen.ComponentBased.Tests { + public class TestEFLWindow : EFLWindowInfo + { + public TestEFLWindow(Window win) : base(win) + { + } + public void DoDispose(bool disposing) + { + Dispose(disposing); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + } + } [TestFixture] [Description("EFLWindowInfo Class Tests")] @@ -82,5 +97,59 @@ namespace Tizen.ComponentBased.Tests Assert.IsInstanceOf(info, "Should return EFLWindowInfo."); Assert.GreaterOrEqual(info.ResourceId, 0); } + + [Test] + [Category("P1")] + [Description("Test : Disposes window of the EFLWindowInfo.")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Default.EFLWindowInfo.Dispose M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + public void Dispose_Released_Value() + { + var window = new Window("test"); + Assert.NotNull(window, "Should not return NULL"); + Assert.IsInstanceOf(window, "Should return Window."); + + var info = new EFLWindowInfo(window); + Assert.NotNull(info, "Should not return NULL"); + Assert.IsInstanceOf(info, "Should return EFLWindowInfo."); + + info.Dispose(); + Assert.IsFalse(window.IsRealized, "Should return False."); + } + + [Test] + [Category("P1")] + [Description("Test : Disposes window of the EFLWindowInfo with parameter.")] + [Property("SPEC", "Tizen.Applications.ComponentBased.Default.EFLWindowInfo.Dispose M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MR")] + [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")] + [Property("COVPARAM", "bool")] + public void Dispose_WITH_PARAM() + { + var window = new Window("test"); + Assert.NotNull(window, "Should not return NULL"); + Assert.IsInstanceOf(window, "Should return Window."); + + var info = new TestEFLWindow(window); + Assert.NotNull(info, "Should not return NULL"); + Assert.IsInstanceOf(info, "Should return TestEFLWindow."); + + info.DoDispose(false); + Assert.IsTrue(window.IsRealized, "Should return TRUE."); + + var window2 = new Window("test"); + Assert.NotNull(window2, "Should not return NULL"); + Assert.IsInstanceOf(window2, "Should return Window."); + + var info2 = new TestEFLWindow(window2); + Assert.NotNull(info2, "Should not return NULL"); + Assert.IsInstanceOf(info2, "Should return TestEFLWindow."); + + info2.DoDispose(true); + Assert.IsFalse(window2.IsRealized, "Should return FALSE."); + } } } -- 2.7.4