[MediaPlayer][Non-ACR] fix the wrong TCs 91/218691/1
authorruble <just.nam@samsung.com>
Thu, 21 Nov 2019 04:49:08 +0000 (13:49 +0900)
committerruble <just.nam@samsung.com>
Wed, 27 Nov 2019 04:54:31 +0000 (13:54 +0900)
Change-Id: I069f828d8a78679f1fb4366a36c1d01c24fe8a3c

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

index 4589c28..da86693 100755 (executable)
@@ -2358,6 +2358,7 @@ namespace Tizen.Multimedia.Tests
             try
             {
                 checkEquals = TestPlayer.AudioPitchEnabled.Equals(false);
+                Assert.That(checkEquals, Is.EqualTo(true));
             }
             catch (NotAvailableException)
             {
@@ -2367,10 +2368,6 @@ namespace Tizen.Multimedia.Tests
                 else
                     Assert.Fail($"exeption occurs even though software codec is used.");
             }
-            finally
-            {
-                Assert.That(checkEquals, Is.EqualTo(true));
-            }
         }
 
         [Test]
@@ -2385,6 +2382,7 @@ namespace Tizen.Multimedia.Tests
             try
             {
                 TestPlayer.AudioPitchEnabled = true;
+                Assert.That(TestPlayer.AudioPitchEnabled, Is.EqualTo(true));
             }
             catch (NotAvailableException)
             {
@@ -2394,10 +2392,6 @@ namespace Tizen.Multimedia.Tests
                 else
                     Assert.Fail($"exeption occurs even though software codec is used.");
             }
-            finally
-            {
-                Assert.That(TestPlayer.AudioPitchEnabled, Is.EqualTo(true));
-            }
         }
 
         [Test]
@@ -2451,6 +2445,7 @@ namespace Tizen.Multimedia.Tests
             try
             {
                 TestPlayer.AudioPitchEnabled = true;
+                Assert.That(TestPlayer.AudioPitch, Is.EqualTo(1));
             }
             catch (NotAvailableException)
             {
@@ -2460,10 +2455,6 @@ namespace Tizen.Multimedia.Tests
                 else
                     Assert.Fail($"exeption occurs even though software codec is used.");
             }
-            finally
-            {
-                Assert.That(TestPlayer.AudioPitch, Is.EqualTo(1));
-            }
         }
 
         [Test]
@@ -2478,6 +2469,10 @@ namespace Tizen.Multimedia.Tests
             try
             {
                 TestPlayer.AudioPitchEnabled = true;
+
+                const float value = 1.212F;
+                TestPlayer.AudioPitch = value;
+                Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
             }
             catch (NotAvailableException)
             {
@@ -2487,12 +2482,6 @@ namespace Tizen.Multimedia.Tests
                 else
                     Assert.Fail($"exeption occurs even though software codec is used.");
             }
-            finally
-            {
-                const float value = 1.212F;
-                TestPlayer.AudioPitch = value;
-                Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
-            }
         }
 
         [Test]
@@ -2507,6 +2496,10 @@ namespace Tizen.Multimedia.Tests
             try
             {
                 TestPlayer.AudioPitchEnabled = true;
+
+                const float value = 0.5F;
+                TestPlayer.AudioPitch = value;
+                Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
             }
             catch (NotAvailableException)
             {
@@ -2516,12 +2509,6 @@ namespace Tizen.Multimedia.Tests
                 else
                     Assert.Fail($"exeption occurs even though software codec is used.");
             }
-            finally
-            {
-                const float value = 0.5F;
-                TestPlayer.AudioPitch = value;
-                Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
-            }
         }
 
         [Test]
@@ -2536,6 +2523,10 @@ namespace Tizen.Multimedia.Tests
             try
             {
                 TestPlayer.AudioPitchEnabled = true;
+
+                const float value = 2.0F;
+                TestPlayer.AudioPitch = value;
+                Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
             }
             catch (NotAvailableException)
             {
@@ -2545,12 +2536,6 @@ namespace Tizen.Multimedia.Tests
                 else
                     Assert.Fail($"exeption occurs even though software codec is used.");
             }
-            finally
-            {
-                const float value = 2.0F;
-                TestPlayer.AudioPitch = value;
-                Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value));
-            }
         }
 
         [Test]
@@ -2562,9 +2547,20 @@ namespace Tizen.Multimedia.Tests
         [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>());
+            try
+            {
+                TestPlayer.AudioPitchEnabled = true;
+                Assert.That(() => TestPlayer.AudioPitch = 0.4F, Throws.TypeOf<ArgumentOutOfRangeException>());
+                Assert.That(() => TestPlayer.AudioPitch = 2.1F, Throws.TypeOf<ArgumentOutOfRangeException>());
+            }
+            catch (NotAvailableException)
+            {
+                CodecType codecType = TestPlayer.AudioCodecType;
+                if (codecType == CodecType.Hardware)
+                    Assert.Pass($"It could be not available depending on the platform capabilities");
+                else
+                    Assert.Fail($"exeption occurs even though software codec is used.");
+            }
         }
 
         [Test]
@@ -2576,8 +2572,19 @@ namespace Tizen.Multimedia.Tests
         [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>());
+            try
+            {
+                TestPlayer.AudioPitchEnabled = false;
+                Assert.That(() => TestPlayer.AudioPitch = 0.82F, Throws.TypeOf<InvalidOperationException>());
+            }
+            catch (NotAvailableException)
+            {
+                CodecType codecType = TestPlayer.AudioCodecType;
+                if (codecType == CodecType.Hardware)
+                    Assert.Pass($"It could be not available depending on the platform capabilities");
+                else
+                    Assert.Fail($"exeption occurs even though software codec is used.");
+            }
         }
 
         [Test]