[MediaTool][TCSACR-199][Add new API for the VideoMediaFormat] 71/194571/2
authorHaesu Gwon <haesu.gwon@samsung.com>
Thu, 6 Dec 2018 02:27:28 +0000 (11:27 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Mon, 10 Dec 2018 02:00:18 +0000 (02:00 +0000)
Change-Id: I1b35f86fac627cd7b24e9b6b07b3c52db64c68d3

tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSVideoMediaFormat.cs

index ba5f8eea0dc5a8ff0a18a69931364d68fa4acd70..95a8d3deca9db8d518823a7d0565e28db0c3857f 100644 (file)
@@ -66,6 +66,29 @@ namespace Tizen.Multimedia.Tests
             Assert.AreEqual(VALID_VIDEO_MAX_BPS, videoFormat.MaxBps);
         }
 
+        [Test]
+        [Category("P1")]
+        [Description("Create VideoMediaFormat")]
+        [Property("SPEC", "Tizen.Multimedia.VideoMediaFormat.VideoMediaFormat C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("COVPARAM", "MediaFormatVideoMimeType, int, int, int, int, int")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void VideoMediaFormat_PROPERTIES_ARE_SET_BY_CONSTRUCTOR_WITH_INT()
+        {
+            const MediaFormatVideoMimeType mimeType = MediaFormatVideoMimeType.Argb;
+
+            var videoFormat = new VideoMediaFormat(mimeType, VALID_VIDEO_WIDTH,
+                VALID_VIDEO_HEIGHT, VALID_VIDEO_FRAME_RATE, VALID_VIDEO_BIT_RATE, VALID_VIDEO_MAX_BPS);
+
+            Assert.AreEqual(mimeType, videoFormat.MimeType);
+            Assert.AreEqual(VALID_VIDEO_WIDTH, videoFormat.Size.Width);
+            Assert.AreEqual(VALID_VIDEO_HEIGHT, videoFormat.Size.Height);
+            Assert.AreEqual(VALID_VIDEO_FRAME_RATE, videoFormat.FrameRate);
+            Assert.AreEqual(VALID_VIDEO_BIT_RATE, videoFormat.BitRate);
+            Assert.AreEqual(VALID_VIDEO_MAX_BPS, videoFormat.MaxBps);
+        }
+
         [Test]
         [Category("P2")]
         [Description("Throw if the specified mime type is invalid")]
@@ -132,6 +155,31 @@ namespace Tizen.Multimedia.Tests
                 Throws.TypeOf<ArgumentOutOfRangeException>());
         }
 
+        [Test]
+        [Category("P2")]
+        [Description("Throw if one of the specified parameters is invalid")]
+        [Property("SPEC", "Tizen.Multimedia.VideoMediaFormat.VideoMediaFormat C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTX")]
+        [Property("COVPARAM", "MediaFormatVideoMimeType, int, int, int, int, int")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void VideoMediaFormat_WITH_INVALID_SIZE_WITH_VALID_OTHERS()
+        {
+            Assert.That(() => new VideoMediaFormat(MediaFormatVideoMimeType.Argb,
+                                            INVALID_VIDEO_WIDTH, VALID_VIDEO_HEIGHT,
+                                            VALID_VIDEO_FRAME_RATE,
+                                            VALID_VIDEO_BIT_RATE,
+                                            VALID_VIDEO_MAX_BPS),
+                Throws.TypeOf<ArgumentOutOfRangeException>());
+
+            Assert.That(() => new VideoMediaFormat(MediaFormatVideoMimeType.Argb,
+                                            VALID_VIDEO_WIDTH, INVALID_VIDEO_HEIGHT,
+                                            VALID_VIDEO_FRAME_RATE,
+                                            VALID_VIDEO_BIT_RATE,
+                                            VALID_VIDEO_MAX_BPS),
+                Throws.TypeOf<ArgumentOutOfRangeException>());
+        }
+
         [Test]
         [Category("P2")]
         [Description("Throw if one of the specified parameters is invalid")]