[MediaPlayer][TCSACR-240] add TCs for controlling an audio pitch 10/203610/2
authornam <just.nam@samsung.com>
Tue, 16 Apr 2019 07:36:06 +0000 (16:36 +0900)
committernam <just.nam@samsung.com>
Wed, 17 Apr 2019 02:07:52 +0000 (11:07 +0900)
Change-Id: I4dd35ec823e2b934409e8a09a08747d0c8a5e0b7

tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs

index b8d7be67af90800e4676d5852fba2ea3a0a9f28a..d05f951e09c91a6f534354b72344df621f441f52 100755 (executable)
@@ -1868,5 +1868,163 @@ namespace Tizen.Multimedia.Tests
             Assert.That(() => TestPlayer.GetVideoRoi(), Throws.TypeOf<ObjectDisposedException>());
         }
         #endregion
+
+        #region AudioPitch
+
+        [Test]
+        [Category("P1")]
+        [Description("AudioPitchEnabled check default value")]
+        [Property("SPEC", "Tizen.Multimedia.Player.AudioPitchEnabled A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+        public void AudioPitchEnabled_DEFAULT()
+        {
+            Assert.That(TestPlayer.AudioPitchEnabled, Is.EqualTo(false));
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("AudioPitchEnabled normal set test")]
+        [Property("SPEC", "Tizen.Multimedia.Player.AudioPitchEnabled A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+        public void AudioPitchEnabled_CHECK()
+        {
+            TestPlayer.AudioPitchEnabled = true;
+            Assert.That(TestPlayer.AudioPitchEnabled, Is.EqualTo(true));
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Any attempt to access the ReplayGain if the player has been disposed of")]
+        [Property("SPEC", "Tizen.Multimedia.Player.AudioPitchEnabled A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PEX")]
+        [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+        public async Task AudioPitchEnabled_THROWS_IF_NOT_VALID_STATE()
+        {
+            var player = await GetPreparedPlayer();
+            Assert.That(() => TestPlayer.AudioPitchEnabled = true, Throws.InvalidOperationException);
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Any attempt to access the ReplayGain if the player has been disposed of")]
+        [Property("SPEC", "Tizen.Multimedia.Player.AudioPitchEnabled A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PEX")]
+        [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+        public void AudioPitchEnabled_DISPOSED()
+        {
+            GetIdlePlayer().Dispose();
+            Assert.That(() => TestPlayer.AudioPitchEnabled = true, Throws.TypeOf<ObjectDisposedException>());
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("AudioPitch check default value")]
+        [Property("SPEC", "Tizen.Multimedia.Player.AudioPitch A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+        public void AudioPitch_DEFAULT()
+        {
+            TestPlayer.AudioPitchEnabled = true;
+            Assert.That(TestPlayer.AudioPitch, Is.EqualTo(1));
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("AudioPitch normal set test")]
+        [Property("SPEC", "Tizen.Multimedia.Player.AudioPitch A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+        public void AudioPitch_CHECK()
+        {
+            const float value = 1.212F;
+
+            TestPlayer.AudioPitchEnabled = true;
+            TestPlayer.AudioPitch = value;
+
+            Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("AudioPitch with the min value")]
+        [Property("SPEC", "Tizen.Multimedia.Player.AudioPitch A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PMIN")]
+        [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+        public void AudioPitch_MIN_VALUE()
+        {
+            const float value = 0.5F;
+
+            TestPlayer.AudioPitchEnabled = true;
+            TestPlayer.AudioPitch = value;
+
+            Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("AudioPitch with the max value")]
+        [Property("SPEC", "Tizen.Multimedia.Player.AudioPitch A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PMAX")]
+        [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+        public void AudioPitch_MAX_VALUE()
+        {
+            const float value = 2.0F;
+
+            TestPlayer.AudioPitchEnabled = true;
+            TestPlayer.AudioPitch = value;
+
+            Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("AudioPitch throws exceptions if out of range")]
+        [Property("SPEC", "Tizen.Multimedia.Player.AudioPitch A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PEX")]
+        [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+        public void AudioPitch_OUT_OF_RANGE()
+        {
+            TestPlayer.AudioPitchEnabled = true;
+            Assert.That(() => TestPlayer.AudioPitch = 0.4F, Throws.TypeOf<ArgumentOutOfRangeException>());
+            Assert.That(() => TestPlayer.AudioPitch = 2.1F, Throws.TypeOf<ArgumentOutOfRangeException>());
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("AudioPitch throws exceptions if pitch is not enabled")]
+        [Property("SPEC", "Tizen.Multimedia.Player.AudioPitch A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PEX")]
+        [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+        public void AudioPitch_IS_NOT_ENABLED()
+        {
+            TestPlayer.AudioPitchEnabled = false;
+            Assert.That(() => TestPlayer.AudioPitch = 0.82F, Throws.TypeOf<InvalidOperationException>());
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Any attempt to access the ReplayGain if the player has been disposed of")]
+        [Property("SPEC", "Tizen.Multimedia.Player.AudioPitch A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PEX")]
+        [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")]
+        public void AudioPitch_DISPOSED()
+        {
+            GetIdlePlayer().Dispose();
+            Assert.That(() => TestPlayer.AudioPitch = 1.0F, Throws.TypeOf<ObjectDisposedException>());
+        }
+        #endregion
     }
 }