[MediaController][TCSACR-255] Add the constructor of MediaControlSearchCondition 60/211460/2
authorHaesu Gwon <haesu.gwon@samsung.com>
Mon, 5 Aug 2019 08:23:33 +0000 (17:23 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Tue, 6 Aug 2019 05:16:47 +0000 (14:16 +0900)
Change-Id: Ida2167fe3430ee5d49cf212fae3b3d5fce6073eb

tct-suite-vs/Tizen.MediaController.Tests/testcase/TSMediaControlSearchCondition.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 88179e6..2c01171
@@ -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<MediaControlSearchCondition>(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<ArgumentException>(() => new MediaControlSearchCondition(MediaControlContentType.Image - 1,
+                MediaControlSearchCategory.Artist, "GD"));
+            Assert.Throws<ArgumentException>(() => new MediaControlSearchCondition(MediaControlContentType.NotDecided + 1,
+                MediaControlSearchCategory.Artist, "GD"));
+
+            Assert.Throws<ArgumentException>(() => new MediaControlSearchCondition(MediaControlContentType.Image,
+                MediaControlSearchCategory.All - 1, "GD"));
+            Assert.Throws<ArgumentException>(() => new MediaControlSearchCondition(MediaControlContentType.Image,
+                MediaControlSearchCategory.Tpo + 1, "GD"));
+
+            Assert.Throws<ArgumentNullException>(() => 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<MediaControlSearchCondition>(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<ArgumentException>(() => new MediaControlSearchCondition(MediaControlContentType.Image - 1, "GD"));
+            Assert.Throws<ArgumentException>(() => new MediaControlSearchCondition(MediaControlContentType.NotDecided + 1, "GD"));
+
+            Assert.Throws<ArgumentNullException>(() => 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", "-")]