[TCSACR-479][WebRTC] Add new MediaFileSource API 36/277336/2
authorHaesu Gwon <haesu.gwon@samsung.com>
Tue, 5 Jul 2022 08:06:31 +0000 (17:06 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Fri, 8 Jul 2022 00:03:50 +0000 (09:03 +0900)
Change-Id: Id31bf514a496f555be4a9e451e3170b2b40dd449

tct-suite-vs/Tizen.WebRTC.Tests/res/test.mp3 [new file with mode: 0755]
tct-suite-vs/Tizen.WebRTC.Tests/testcase/TSMediaFileSource.cs [new file with mode: 0755]
tct-suite-vs/Tizen.WebRTC.Tests/testcase/support/TestBase.cs

diff --git a/tct-suite-vs/Tizen.WebRTC.Tests/res/test.mp3 b/tct-suite-vs/Tizen.WebRTC.Tests/res/test.mp3
new file mode 100755 (executable)
index 0000000..5fb75b1
Binary files /dev/null and b/tct-suite-vs/Tizen.WebRTC.Tests/res/test.mp3 differ
diff --git a/tct-suite-vs/Tizen.WebRTC.Tests/testcase/TSMediaFileSource.cs b/tct-suite-vs/Tizen.WebRTC.Tests/testcase/TSMediaFileSource.cs
new file mode 100755 (executable)
index 0000000..33a2d5d
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ *  Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License
+ */
+
+using NUnit.Framework;
+
+namespace Tizen.Multimedia.Remoting.Tests {
+
+    [TestFixture]
+    [Description("Tizen.Multimedia.Remoting.MediaFileSource Tests")]
+    public class MediaFileSourceTests : TestBase
+    {
+        [Test]
+        [Category("P1")]
+        [Description("Create the MediaFileSource instance and check whether instance is created property or not.")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaFileSource.MediaFileSource C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void MediaFileSource_INIT_VIDEO()
+        {
+            var mediaFileSource = new MediaFileSource(MediaType.Video, VideoFilePath);
+            Assert.IsNotNull(mediaFileSource, "MediaFileSource should not be null.");
+            Assert.IsInstanceOf<MediaFileSource>(mediaFileSource, "Should return MediaFileSource instance.");
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Create the MediaFileSource instance and check whether instance is created property or not.")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaFileSource.MediaFileSource C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void MediaFileSource_INIT_AUDIO()
+        {
+            var mediaFileSource = new MediaFileSource(MediaType.Audio, AudioFilePath);
+            Assert.IsNotNull(mediaFileSource, "MediaFileSource should not be null.");
+            Assert.IsInstanceOf<MediaFileSource>(mediaFileSource, "Should return MediaFileSource instance.");
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Create the MediaFileSource instance with invalid parameter and check whether throws exception or not.")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaFileSource.MediaFileSource C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTX")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void MediaFileSource_THROWS_IF_NULL_PARAM_AUDIO()
+        {
+            Assert.That(() => new MediaFileSource(MediaType.Audio, null), Throws.ArgumentNullException,
+                "Should throw ArgumentNullException");
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Create the MediaFileSource instance with invalid parameter and check whether throws exception or not.")]
+        [Property("SPEC", "Tizen.Multimedia.Remoting.MediaFileSource.MediaFileSource C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTX")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void MediaFileSource_THROWS_IF_NULL_PARAM_VIDEO()
+        {
+            Assert.That(() => new MediaFileSource(MediaType.Video, null), Throws.ArgumentNullException,
+                "Should throw ArgumentNullException");
+        }
+    }
+}
\ No newline at end of file
index a557ff1..4d2c816 100644 (file)
@@ -24,6 +24,7 @@ namespace Tizen.Multimedia.Remoting.Tests
     public class TestBase
     {
         protected const string VideoFilePath = "/opt/usr/home/owner/share/res/test.h264";
+        protected const string AudioFilePath = "/opt/usr/home/owner/share/res/test.mp3";
 
         protected readonly MediaFormat SimpleFormat =
             new VideoMediaFormat(MediaFormatVideoMimeType.Mpeg4SP, 640, 480);