[TCSACR-541][MediaPlayer] Add new API to set video codec type 58/294758/3
authorHaesu Gwon <haesu.gwon@samsung.com>
Mon, 26 Jun 2023 07:28:44 +0000 (16:28 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Mon, 10 Jul 2023 02:47:51 +0000 (11:47 +0900)
Change-Id: Ibabd4cfec53ecda3a9c06571270178ce3ac0b9bf

tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSNotAvailableException.cs [new file with mode: 0644]
tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs

diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSNotAvailableException.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSNotAvailableException.cs
new file mode 100644 (file)
index 0000000..da98cd5
--- /dev/null
@@ -0,0 +1,22 @@
+using NUnit.Framework;
+
+namespace Tizen.Multimedia.Tests
+{
+
+    [TestFixture]
+    [Description("Tizen.Multimedia.NotAvailableException Tests")]
+    public class NotAvailableExceptionTests
+    {
+        [Test]
+        [Category("P1")]
+        [Description("Constructor test")]
+        [Property("SPEC", "Tizen.Multimedia.NotAvailableException.NotAvailableException C")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "CONSTR")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void NotAvailableException_CHECK()
+        {
+            Assert.DoesNotThrow(() => new NotAvailableException("message"));
+        }
+    }
+}
index c949c28..07b9c46 100644 (file)
@@ -2787,6 +2787,58 @@ namespace Tizen.Multimedia.Tests
             GetIdlePlayer().Dispose();
             Assert.That(() => TestPlayer.AudioCodecType = CodecType.Hardware, Throws.TypeOf<ObjectDisposedException>());
         }
+
+        [Test]
+        [Category("P1")]
+        [Description("Check VideoCodecType does not throw exceptions")]
+        [Property("SPEC", "Tizen.Multimedia.Player.VideoCodecType A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void VideoCodecType_CHECK()
+        {
+            TestPlayer.VideoCodecType = CodecType.Software;
+            Assert.That(TestPlayer.VideoCodecType, Is.EqualTo(CodecType.Software));
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("VideoCodecType throws exception if the player is in a not valid state")]
+        [Property("SPEC", "Tizen.Multimedia.Player.VideoCodecType A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PEX")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public async Task VideoCodecType_THROWS_IF_NOT_VALID_STATE()
+        {
+            var player = await GetPreparedPlayer();
+            Assert.That(() => player.VideoCodecType = CodecType.Hardware, Throws.InvalidOperationException);
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("VideoCodecType throw exception if the param is not valid")]
+        [Property("SPEC", "Tizen.Multimedia.Player.VideoCodecType M")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PEX")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void VideoCodecType_THROWS_IF_PARAM_NOT_VALID()
+        {
+            var player = GetIdlePlayer();
+            Assert.That(() => player.VideoCodecType = (CodecType)5, Throws.ArgumentException);
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Any attempt to access the VideoCodecType if the player has been disposed of")]
+        [Property("SPEC", "Tizen.Multimedia.Player.VideoCodecType A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PEX")]
+        [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+        public void VideoCodecType_DISPOSED()
+        {
+            GetIdlePlayer().Dispose();
+            Assert.That(() => TestPlayer.VideoCodecType = CodecType.Hardware, Throws.TypeOf<ObjectDisposedException>());
+        }
         #endregion
     }
 }