Skip to content

Commit e5d0cbb

Browse files
Copilotstephentoub
andcommitted
Fix tests: Skip non-serializable data tests on .NET Framework
Co-authored-by: stephentoub <[email protected]>
1 parent a47be0d commit e5d0cbb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/ModelContextProtocol.Tests/McpProtocolExceptionDataTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ namespace ModelContextProtocol.Tests;
1717
/// </remarks>
1818
public class McpProtocolExceptionDataTests : ClientServerTestBase
1919
{
20+
public static bool IsNotNetFramework => !PlatformDetection.IsNetFramework;
21+
2022
public McpProtocolExceptionDataTests(ITestOutputHelper testOutputHelper)
2123
: base(testOutputHelper)
2224
{
@@ -99,7 +101,7 @@ public async Task Exception_With_Serializable_Data_Propagates_To_Client()
99101
Assert.Equal(404.0, exception.Data["code"]); // Numbers are stored as double
100102
}
101103

102-
[Fact]
104+
[Fact(Skip = "Non-serializable test data not supported on .NET Framework", SkipUnless = nameof(IsNotNetFramework))]
103105
public async Task Exception_With_NonSerializable_Data_Still_Propagates_Error_To_Client()
104106
{
105107
await using McpClient client = await CreateMcpClientForServer();
@@ -130,7 +132,7 @@ public async Task Exception_With_NonSerializable_Data_Still_Propagates_Error_To_
130132
Assert.Equal("file:///path/to/resource", exception.Data["uri"]);
131133
}
132134

133-
[Fact]
135+
[Fact(Skip = "Non-serializable test data not supported on .NET Framework", SkipUnless = nameof(IsNotNetFramework))]
134136
public async Task Exception_With_Only_NonSerializable_Data_Still_Propagates_Error_To_Client()
135137
{
136138
await using McpClient client = await CreateMcpClientForServer();

0 commit comments

Comments
 (0)