From 2041aa961a3f9e5bc400a083ea01b24f9c6aeae4 Mon Sep 17 00:00:00 2001 From: Haesu Gwon Date: Mon, 5 Aug 2019 17:23:33 +0900 Subject: [PATCH] [MediaController][TCSACR-255] Add the constructor of MediaControlSearchCondition Change-Id: Ida2167fe3430ee5d49cf212fae3b3d5fce6073eb --- .../testcase/TSMediaControlSearchCondition.cs | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) mode change 100755 => 100644 tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlSearchCondition.cs diff --git a/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlSearchCondition.cs b/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlSearchCondition.cs old mode 100755 new mode 100644 index 88179e6..2c01171 --- a/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlSearchCondition.cs +++ b/tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlSearchCondition.cs @@ -112,6 +112,78 @@ namespace Tizen.Multimedia.Remoting.Tests [Test] [Category("P1")] + [Description("Create MediaControlSearchCondition instance with content type, category, keyword and buldle")] + [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlSearchCondition.MediaControlSearchCondition C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("COVPARAM", "MediaControlContentType, MediaControlSearchCategory, string")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void MediaControlSearchCondition_CHECK_CREATE_CONSTRUCTOR_WITHOUT_BUNDLE() + { + var condition = new MediaControlSearchCondition(MediaControlContentType.Image, MediaControlSearchCategory.All, "GD"); + + Assert.IsNotNull(condition, "Object should not be null after initializing"); + Assert.IsInstanceOf(condition, "Should return MediaControlSearchCondition instance"); + } + + [Test] + [Category("P2")] + [Description("Check whether MediaControlSearchCondition throws exception if parameter is invalid")] + [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlSearchCondition.MediaControlSearchCondition C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTX")] + [Property("COVPARAM", "MediaControlContentType, MediaControlSearchCategory, string")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void MediaControlSearchCondition_THROWS_EXCEPTION_WITHOUT_BUNDLE() + { + Assert.Throws(() => new MediaControlSearchCondition(MediaControlContentType.Image - 1, + MediaControlSearchCategory.Artist, "GD")); + Assert.Throws(() => new MediaControlSearchCondition(MediaControlContentType.NotDecided + 1, + MediaControlSearchCategory.Artist, "GD")); + + Assert.Throws(() => new MediaControlSearchCondition(MediaControlContentType.Image, + MediaControlSearchCategory.All - 1, "GD")); + Assert.Throws(() => new MediaControlSearchCondition(MediaControlContentType.Image, + MediaControlSearchCategory.Tpo + 1, "GD")); + + Assert.Throws(() => new MediaControlSearchCondition(MediaControlContentType.Image, + MediaControlSearchCategory.Artist, null)); + } + + [Test] + [Category("P1")] + [Description("Create MediaControlSearchCondition instance with content type, keyword, buldle and all category")] + [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlSearchCondition.MediaControlSearchCondition C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("COVPARAM", "MediaControlContentType, string")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void MediaControlSearchCondition_CHECK_CREATE_CONSTRUCTOR_WITH_ALL_CATEGORY_WITHOUT_BUNDLE() + { + var condition = new MediaControlSearchCondition(MediaControlContentType.Image, "GD"); + + Assert.IsNotNull(condition, "Object should not be null after initializing"); + Assert.IsInstanceOf(condition, "Should return MediaControlSearchCondition instance"); + } + + [Test] + [Category("P2")] + [Description("Check whether MediaControlSearchCondition throws exception if parameter is invalid")] + [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlSearchCondition.MediaControlSearchCondition C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTX")] + [Property("COVPARAM", "MediaControlContentType, string")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void MediaControlSearchCondition_WITH_ALL_CATEGORY_THROWS_EXCEPTION_WITHOUT_BUNDLE() + { + Assert.Throws(() => new MediaControlSearchCondition(MediaControlContentType.Image - 1, "GD")); + Assert.Throws(() => new MediaControlSearchCondition(MediaControlContentType.NotDecided + 1, "GD")); + + Assert.Throws(() => new MediaControlSearchCondition(MediaControlContentType.Image, null)); + } + + [Test] + [Category("P1")] [Description("Check whether ContentType property is type of MediaControlContentType or not.")] [Property("SPEC", "Tizen.Multimedia.Remoting.MediaControlSearchCondition.ContentType A")] [Property("SPEC_URL", "-")] -- 2.7.4