Skip to content

Commit b09ae1a

Browse files
authored
Skip HostAbortedExceptionTests when BinaryFormatter isn't supported (#70151)
Fix #70132
1 parent 12c31dc commit b09ae1a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostAbortedExceptionTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void TestException(string? message, bool innerException)
3737
Assert.Equal(message, thrownException.Message);
3838
}
3939

40-
[Theory]
40+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))]
4141
[InlineData("Test Message")]
4242
[InlineData(null)]
4343
public void TestSerialization(string? message)
@@ -55,8 +55,9 @@ public void TestSerialization(string? message)
5555
Assert.Null(deserializedException.InnerException);
5656
}
5757

58-
[Fact]
59-
public void TestSerializationDefaultConstructor() {
58+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))]
59+
public void TestSerializationDefaultConstructor()
60+
{
6061
var exception = new HostAbortedException();
6162
using var serializationStream = new MemoryStream();
6263

0 commit comments

Comments
 (0)