From dc04596864e29772ce994a3d5148e79aa129170d Mon Sep 17 00:00:00 2001 From: Haesu Gwon Date: Thu, 28 Jun 2018 12:53:59 +0900 Subject: [PATCH] [MediaController][Non-ACR][Start method behavior was changed to returns exception when it calls twice] Change-Id: I0e68c22be05d798eebfc2309f09915ea17e53bac Signed-off-by: Haesu Gwon --- .../testcase/TSMediaControlServer.cs | 44 +++++++++++++++++++--- .../TSMediaControllerManager_NoServerStarted.cs | 10 ++++- 2 files changed, 47 insertions(+), 7 deletions(-) mode change 100755 => 100644 tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlServer.cs mode change 100755 => 100644 tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControllerManager_NoServerStarted.cs diff --git a/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlServer.cs b/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlServer.cs old mode 100755 new mode 100644 index 3df74da..94ca6e3 --- a/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlServer.cs +++ b/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlServer.cs @@ -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")] diff --git a/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControllerManager_NoServerStarted.cs b/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControllerManager_NoServerStarted.cs old mode 100755 new mode 100644 index d524b2b..4a984e8 --- a/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControllerManager_NoServerStarted.cs +++ b/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControllerManager_NoServerStarted.cs @@ -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, + "Should return mediaControllerManager instance"); + } } [Test] -- 2.7.4