From: nam Date: Tue, 16 Apr 2019 07:36:06 +0000 (+0900) Subject: [MediaPlayer][TCSACR-240] add TCs for controlling an audio pitch X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9efaeaff57fd8607501cf1bbda0eb6772294ba90;p=test%2Ftct%2Fcsharp%2Fapi.git [MediaPlayer][TCSACR-240] add TCs for controlling an audio pitch Change-Id: I4dd35ec823e2b934409e8a09a08747d0c8a5e0b7 --- diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs index b8d7be67a..d05f951e0 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs @@ -1868,5 +1868,163 @@ namespace Tizen.Multimedia.Tests Assert.That(() => TestPlayer.GetVideoRoi(), Throws.TypeOf()); } #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()); + } + + [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()); + Assert.That(() => TestPlayer.AudioPitch = 2.1F, Throws.TypeOf()); + } + + [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()); + } + + [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()); + } + #endregion } }