[ComponentBased.Default][TCSACR-282] Add Release method TC 74/214774/5
authorhyunho <hhstark.kang@samsung.com>
Thu, 26 Sep 2019 07:46:41 +0000 (16:46 +0900)
committerhyunho <hhstark.kang@samsung.com>
Tue, 1 Oct 2019 07:55:24 +0000 (16:55 +0900)
Change-Id: I6a9742fabdd4df3134cd761b2272d9c6d0e27fa3
Signed-off-by: hyunho <hhstark.kang@samsung.com>
tct-suite-vs/Tizen.ComponentBased.Default.Tests/testcase/TSEFLComponentBasedApplication.cs
tct-suite-vs/Tizen.ComponentBased.Default.Tests/testcase/TSEFLWindowInfo.cs

index c0a4a78..5e9fe93 100644 (file)
@@ -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()
index 1e8f4e6..3aa19c0 100644 (file)
@@ -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<EFLWindowInfo>(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>(window, "Should return Window.");
+
+            var info = new EFLWindowInfo(window);
+            Assert.NotNull(info, "Should not return NULL");
+            Assert.IsInstanceOf<EFLWindowInfo>(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>(window, "Should return Window.");
+
+            var info = new TestEFLWindow(window);
+            Assert.NotNull(info, "Should not return NULL");
+            Assert.IsInstanceOf<TestEFLWindow>(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<Window>(window2, "Should return Window.");
+
+            var info2 = new TestEFLWindow(window2);
+            Assert.NotNull(info2, "Should not return NULL");
+            Assert.IsInstanceOf<TestEFLWindow>(info2, "Should return TestEFLWindow.");
+
+            info2.DoDispose(true);
+            Assert.IsFalse(window2.IsRealized, "Should return FALSE.");
+        }
     }
 }