Skip to content

Commit 8891db7

Browse files
Skip impacted tests and re-enable netfx testing.
1 parent 858fd4b commit 8891db7

7 files changed

Lines changed: 45 additions & 2 deletions

File tree

tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
5+
<TargetFrameworks>net9.0;net8.0;net472</TargetFrameworks>
66
<!-- https://github.com/modelcontextprotocol/csharp-sdk/issues/587 -->
7-
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">$(TargetFrameworks);net472</TargetFrameworks>
87
<ImplicitUsings>enable</ImplicitUsings>
98
<Nullable>enable</Nullable>
109

tests/ModelContextProtocol.Tests/Server/McpServerDelegatesTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
using ModelContextProtocol.Protocol;
22
using ModelContextProtocol.Server;
3+
using System.Runtime.InteropServices;
34

45
namespace ModelContextProtocol.Tests.Server;
56

67
public class McpServerHandlerTests
78
{
9+
public McpServerHandlerTests()
10+
{
11+
#if !NET
12+
Assert.SkipWhen(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "https://github.com/modelcontextprotocol/csharp-sdk/issues/587");
13+
#endif
14+
}
15+
816
[Fact]
917
public void AllPropertiesAreSettable()
1018
{

tests/ModelContextProtocol.Tests/Server/McpServerLoggingLevelTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
using Microsoft.Extensions.DependencyInjection;
22
using ModelContextProtocol.Protocol;
33
using ModelContextProtocol.Server;
4+
using System.Runtime.InteropServices;
45

56
namespace ModelContextProtocol.Tests.Server;
67

78
public class McpServerLoggingLevelTests
89
{
10+
public McpServerLoggingLevelTests()
11+
{
12+
#if !NET
13+
Assert.SkipWhen(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "https://github.com/modelcontextprotocol/csharp-sdk/issues/587");
14+
#endif
15+
}
16+
917
[Fact]
1018
public void CanCreateServerWithLoggingLevelHandler()
1119
{

tests/ModelContextProtocol.Tests/Server/McpServerPromptTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,21 @@
77
using System.ComponentModel;
88
using System.Diagnostics;
99
using System.Reflection;
10+
using System.Runtime.InteropServices;
1011
using System.Text.Json;
1112
using System.Text.Json.Nodes;
1213

1314
namespace ModelContextProtocol.Tests.Server;
1415

1516
public class McpServerPromptTests
1617
{
18+
public McpServerPromptTests()
19+
{
20+
#if !NET
21+
Assert.SkipWhen(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "https://github.com/modelcontextprotocol/csharp-sdk/issues/587");
22+
#endif
23+
}
24+
1725
[Fact]
1826
public void Create_InvalidArgs_Throws()
1927
{

tests/ModelContextProtocol.Tests/Server/McpServerResourceTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,20 @@
44
using ModelContextProtocol.Server;
55
using Moq;
66
using System.Reflection;
7+
using System.Runtime.InteropServices;
78
using System.Text.Json.Serialization;
89

910
namespace ModelContextProtocol.Tests.Server;
1011

1112
public partial class McpServerResourceTests
1213
{
14+
public McpServerResourceTests()
15+
{
16+
#if !NET
17+
Assert.SkipWhen(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "https://github.com/modelcontextprotocol/csharp-sdk/issues/587");
18+
#endif
19+
}
20+
1321
[Fact]
1422
public void CanCreateServerWithResource()
1523
{

tests/ModelContextProtocol.Tests/Server/McpServerTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using ModelContextProtocol.Server;
44
using ModelContextProtocol.Tests.Utils;
55
using System.Reflection;
6+
using System.Runtime.InteropServices;
67
using System.Text.Json;
78
using System.Text.Json.Nodes;
89

@@ -15,6 +16,9 @@ public class McpServerTests : LoggedTest
1516
public McpServerTests(ITestOutputHelper testOutputHelper)
1617
: base(testOutputHelper)
1718
{
19+
#if !NET
20+
Assert.SkipWhen(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "https://github.com/modelcontextprotocol/csharp-sdk/issues/587");
21+
#endif
1822
_options = CreateOptions();
1923
}
2024

tests/ModelContextProtocol.Tests/Server/McpServerToolTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using ModelContextProtocol.Tests.Utils;
88
using Moq;
99
using System.Reflection;
10+
using System.Runtime.InteropServices;
1011
using System.Text.Json;
1112
using System.Text.Json.Nodes;
1213
using System.Text.Json.Serialization;
@@ -17,6 +18,13 @@ namespace ModelContextProtocol.Tests.Server;
1718

1819
public partial class McpServerToolTests
1920
{
21+
public McpServerToolTests()
22+
{
23+
#if !NET
24+
Assert.SkipWhen(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "https://github.com/modelcontextprotocol/csharp-sdk/issues/587");
25+
#endif
26+
}
27+
2028
[Fact]
2129
public void Create_InvalidArgs_Throws()
2230
{

0 commit comments

Comments
 (0)