Make more SoundPlayer tests conditional (dotnet/corefx#34854)
authorStephen Toub <stoub@microsoft.com>
Fri, 25 Jan 2019 20:00:33 +0000 (15:00 -0500)
committerGitHub <noreply@github.com>
Fri, 25 Jan 2019 20:00:33 +0000 (15:00 -0500)
Commit migrated from https://github.com/dotnet/corefx/commit/0fee9027bb97aa8dcda5cbc23f15d923e4b19d34

src/libraries/System.Windows.Extensions/tests/System/Media/SoundPlayerTests.cs

index 8c75ad9..dd666cc 100644 (file)
@@ -143,7 +143,7 @@ namespace System.Media.Test
             player.Play();
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsSoundPlaySupported))]
         [MemberData(nameof(Play_String_TestData))]
         [OuterLoop]
         public void Load_Stream_Success(string sourceLocation)
@@ -237,7 +237,7 @@ namespace System.Media.Test
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsSoundPlaySupported))]
         [OuterLoop]
         public void Play_NullStream_Success()
         {
@@ -257,7 +257,7 @@ namespace System.Media.Test
             Assert.Throws<InvalidOperationException>(() => soundPlayer.Play());
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsSoundPlaySupported))]
         [MemberData(nameof(Play_InvalidString_TestData))]
         public void Play_InvalidStream_ThrowsInvalidOperationException(string sourceLocation)
         {
@@ -268,7 +268,7 @@ namespace System.Media.Test
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsSoundPlaySupported))]
         [OuterLoop]
         public void PlayLooping_NullStream_Success()
         {
@@ -279,7 +279,7 @@ namespace System.Media.Test
             player.PlayLooping();
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsSoundPlaySupported))]
         [OuterLoop]
         public void PlaySync_NullStream_Success()
         {
@@ -480,7 +480,7 @@ namespace System.Media.Test
             Assert.Null(ea.UserState);
         }
 
-        [Theory]
+        [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsSoundPlaySupported))]
         [MemberData(nameof(Play_String_TestData))]
         [OuterLoop]
         public async Task CancelDuringLoad_ThenPlay_Success(string sourceLocation)