[MediaController][Non-ACR][Start method behavior was changed to returns exception... 81/182781/5
authorHaesu Gwon <haesu.gwon@samsung.com>
Thu, 28 Jun 2018 03:53:59 +0000 (12:53 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Thu, 5 Jul 2018 05:34:00 +0000 (05:34 +0000)
Change-Id: I0e68c22be05d798eebfc2309f09915ea17e53bac
Signed-off-by: Haesu Gwon <haesu.gwon@samsung.com>
tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlServer.cs [changed mode: 0755->0644]
tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControllerManager_NoServerStarted.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 3df74da..94ca6e3
@@ -19,19 +19,53 @@ namespace Tizen.Multimedia.Remoting.Tests
         [TearDown]
         public void TearDown()
         {
-            MediaControlServer.Stop();
+            if (MediaControlServer.IsRunning)
+            {
+                MediaControlServer.Stop();
+            }
         }
 
         [Test]
         [Category("P1")]
-        [Description("Does not throw even if start again")]
+        [Description("Test Start method and check its state.")]
         [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.Start M")]
         [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "MR")]
+        [Property("CRITERIA", "MCST")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Start_CHANGE_STATUS()
+        {
+            MediaControlServer.Stop();
+            Assert.That(MediaControlServer.IsRunning, Is.False);
+
+            MediaControlServer.Start();
+            Assert.That(MediaControlServer.IsRunning, Is.True);
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Throws exception if start again")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.Start M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MEX")]
         [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
         public void Start_TWICE()
         {
-            Assert.That(() => MediaControlServer.Start(), Throws.Nothing);
+            Assert.That(() => MediaControlServer.Start(), Throws.ArgumentException);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Test Stop method and check its state.")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.Stop M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "MCST")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void Stop_CHANGE_STATUS()
+        {
+            Assert.That(MediaControlServer.IsRunning, Is.True);
+
+            MediaControlServer.Stop();
+            Assert.That(MediaControlServer.IsRunning, Is.False);
         }
 
         [Test]
@@ -108,7 +142,7 @@ namespace Tizen.Multimedia.Remoting.Tests
 
         [Test]
         [Category("P2")]
-        [Description("Does not throw if the arg is null")]
+        [Description("Throws exception if the argument is null")]
         [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlServer.SetMetadata M")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "MEX")]
old mode 100755 (executable)
new mode 100644 (file)
index d524b2b..4a984e8
@@ -1,3 +1,4 @@
+using System;
 using NUnit.Framework;
 using System.Threading.Tasks;
 using Tizen.Applications;
@@ -10,14 +11,19 @@ namespace Tizen.Multimedia.Remoting.Tests
     {
         [Test]
         [Category("P1")]
-        [Description("Does not throw")]
+        [Description("Create MediaControllerManager instance")]
         [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControllerManager.MediaControllerManager C")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "CONSTR")]
         [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")]
         public void MediaControllerManager_CHECK_CREATE_CONSTRUCTOR()
         {
-            Assert.That(() => new MediaControllerManager(), Throws.Nothing);
+            using (var mediaControllerManager = new MediaControllerManager())
+            {
+                Assert.IsNotNull(mediaControllerManager, "Object should not be null after initializing");
+                Assert.IsInstanceOf<MediaControllerManager>(mediaControllerManager,
+                    "Should return mediaControllerManager instance");
+            }
         }
 
         [Test]