[Tizen.Applications][TCSACR-260][Add SuspendedState Event] 34/214134/4
authorhyunho <hhstark.kang@samsung.com>
Wed, 18 Sep 2019 09:21:13 +0000 (18:21 +0900)
committerhyunho <hhstark.kang@samsung.com>
Thu, 19 Sep 2019 05:55:32 +0000 (14:55 +0900)
Change-Id: I077f6863a092e25908d2d824499122150e5b568d
Signed-off-by: hyunho <hhstark.kang@samsung.com>
tct-suite-vs/Tizen.Applications.Tests/testcase/TSSuspendedStateEventArgs.cs [new file with mode: 0644]

diff --git a/tct-suite-vs/Tizen.Applications.Tests/testcase/TSSuspendedStateEventArgs.cs b/tct-suite-vs/Tizen.Applications.Tests/testcase/TSSuspendedStateEventArgs.cs
new file mode 100644 (file)
index 0000000..f4dd40d
--- /dev/null
@@ -0,0 +1,61 @@
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+
+namespace Tizen.Applications.Tests
+{
+    [TestFixture]
+    [Description("Tizen.Applications.SuspendedStateEventArgs Tests")]
+    class SuspendedStateEventArgsTests
+    {
+        [SetUp]
+        public void Init()
+        {
+            LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Preconditions for each TEST");
+        }
+
+        [TearDown]
+        public void Destroy()
+        {
+            LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Postconditions for each TEST");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Create a SuspendedStateEventArgs which will be used by applications")]
+        [Property("SPEC", "Tizen.Applications.SuspendedStateEventArgs.SuspendedStateEventArgs C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("AUTHOR", "hhstark.kang, hhstark.kang@samsung.com")]
+        public void SuspendedStateEventArgs_INIT()
+        {
+            /* TEST CODE */
+            var exitSuspendedArg = new SuspendedStateEventArgs(SuspendedState.DidExit);
+            Assert.IsNotNull(exitSuspendedArg, "SuspendedStateEventArgs should be not null  after init");
+            Assert.IsInstanceOf<SuspendedStateEventArgs>(exitSuspendedArg, "Should return SuspendedStateEventArgs.");
+
+            var enterSuspendedArg = new SuspendedStateEventArgs(SuspendedState.WillEnter);
+            Assert.IsNotNull(enterSuspendedArg, "SuspendedStateEventArgs should be not null  after init");
+            Assert.IsInstanceOf<SuspendedStateEventArgs>(enterSuspendedArg, "Should return SuspendedStateEventArgs.");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test : Gets SuspendedState of the SuspendedStateEventArgs")]
+        [Property("SPEC", "Tizen.Applications.SuspendedStateEventArgs.SuspendedState A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRO")]
+        [Property("AUTHOR", "Hyunho Kang, hhstark.kang@samsung.com")]
+        public void SuspendedState_Get_Value()
+        {
+            var exitSuspendedArg = new SuspendedStateEventArgs(SuspendedState.DidExit);
+            Assert.IsNotNull(exitSuspendedArg, "SuspendedStateEventArgs should be not null after init");
+            Assert.IsInstanceOf<SuspendedStateEventArgs>(exitSuspendedArg, "Should return SuspendedStateEventArgs.");
+            Assert.AreEqual(exitSuspendedArg.SuspendedState, SuspendedState.DidExit, "SuspendedState value is not correct");
+
+            var enterSuspendedArg = new SuspendedStateEventArgs(SuspendedState.WillEnter);
+            Assert.IsNotNull(enterSuspendedArg, "SuspendedStateEventArgs should be not null after init");
+            Assert.IsInstanceOf<SuspendedStateEventArgs>(enterSuspendedArg, "Should return SuspendedStateEventArgs.");
+            Assert.AreEqual(enterSuspendedArg.SuspendedState, SuspendedState.WillEnter, "SuspendedState value is not correct");
+        }
+    }
+}