Separate ASP.NET Core tests into a distinct project and make the main test project netfx compatible. (#254)
* Separate ASP.NET Core tests into a distinct project and make the main test project netfx compatible. * Fix merge conflicts. * Update tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj Co-authored-by: Stephen Halter <halter73@gmail.com> * Revert "Fix merge conflicts." This reverts commit 852169b96786bad2144795540fa164e20b4b197e. * Fix merge conflicts --------- Co-authored-by: Stephen Halter <halter73@gmail.com>
This commit is contained in:
parent
08f9cdbf7d
commit
39ab6cde0d
14 changed files with 324 additions and 63 deletions
|
|
@ -0,0 +1 @@
|
|||
global using Xunit;
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>Latest</LangVersion>
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<RootNamespace>ModelContextProtocol.AspNetCore.Tests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Without this, tests are currently not showing results until all tests complete
|
||||
https://xunit.net/docs/getting-started/v3/microsoft-testing-platform
|
||||
-->
|
||||
<DisableTestingPlatformServerCapability>true</DisableTestingPlatformServerCapability>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="GitHubActionsTestLogger">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.AI" />
|
||||
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" />
|
||||
<PackageReference Include="Moq" />
|
||||
<PackageReference Include="OpenTelemetry" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.InMemory" />
|
||||
<PackageReference Include="System.Linq.AsyncEnumerable" />
|
||||
<PackageReference Include="xunit.v3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\samples\TestServerWithHosting\TestServerWithHosting.csproj" />
|
||||
<ProjectReference Include="..\..\src\ModelContextProtocol\ModelContextProtocol.csproj" />
|
||||
<ProjectReference Include="..\..\src\ModelContextProtocol.AspNetCore\ModelContextProtocol.AspNetCore.csproj" />
|
||||
<ProjectReference Include="..\ModelContextProtocol.TestSseServer\ModelContextProtocol.TestSseServer.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using ModelContextProtocol.Tests.Utils;
|
||||
|
||||
namespace ModelContextProtocol.AspNetCore.Tests.Server;
|
||||
|
||||
public class MapMcpTests(ITestOutputHelper testOutputHelper) : KestrelInMemoryTest(testOutputHelper)
|
||||
{
|
||||
[Fact]
|
||||
public async Task Allows_Customizing_Route()
|
||||
{
|
||||
await using var app = Builder.Build();
|
||||
app.MapMcp("/mcp");
|
||||
await app.StartAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
using var httpClient = CreateHttpClient();
|
||||
using var response = await httpClient.GetAsync("http://localhost/mcp/sse", HttpCompletionOption.ResponseHeadersRead, TestContext.Current.CancellationToken);
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,208 @@
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using ModelContextProtocol.Client;
|
||||
using ModelContextProtocol.Protocol.Messages;
|
||||
using ModelContextProtocol.Protocol.Transport;
|
||||
using ModelContextProtocol.Server;
|
||||
using ModelContextProtocol.Tests.Utils;
|
||||
using ModelContextProtocol.Utils.Json;
|
||||
using TestServerWithHosting.Tools;
|
||||
|
||||
namespace ModelContextProtocol.Tests;
|
||||
|
||||
public class SseIntegrationTests(ITestOutputHelper outputHelper) : KestrelInMemoryTest(outputHelper)
|
||||
{
|
||||
private SseClientTransportOptions DefaultTransportOptions = new()
|
||||
{
|
||||
Endpoint = new Uri("http://localhost/sse"),
|
||||
Name = "In-memory Test Server",
|
||||
};
|
||||
|
||||
private Task<IMcpClient> ConnectMcpClient(HttpClient httpClient, McpClientOptions? clientOptions = null)
|
||||
=> McpClientFactory.CreateAsync(
|
||||
new SseClientTransport(DefaultTransportOptions, httpClient, LoggerFactory),
|
||||
clientOptions,
|
||||
LoggerFactory,
|
||||
TestContext.Current.CancellationToken);
|
||||
|
||||
|
||||
[Fact]
|
||||
public async Task ConnectAndReceiveMessage_InMemoryServer()
|
||||
{
|
||||
await using var app = Builder.Build();
|
||||
app.MapMcp();
|
||||
await app.StartAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
using var httpClient = CreateHttpClient();
|
||||
await using var mcpClient = await ConnectMcpClient(httpClient);
|
||||
|
||||
// Send a test message through POST endpoint
|
||||
await mcpClient.SendNotificationAsync("test/message", new { message = "Hello, SSE!" }, cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
||||
Assert.True(true);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ConnectAndReceiveMessage_InMemoryServer_WithFullEndpointEventUri()
|
||||
{
|
||||
await using var app = Builder.Build();
|
||||
MapAbsoluteEndpointUriMcp(app);
|
||||
await app.StartAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
using var httpClient = CreateHttpClient();
|
||||
await using var mcpClient = await ConnectMcpClient(httpClient);
|
||||
|
||||
// Send a test message through POST endpoint
|
||||
await mcpClient.SendNotificationAsync("test/message", new { message = "Hello, SSE!" }, cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
||||
Assert.True(true);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ConnectAndReceiveNotification_InMemoryServer()
|
||||
{
|
||||
var receivedNotification = new TaskCompletionSource<string?>();
|
||||
|
||||
await using var app = Builder.Build();
|
||||
app.MapMcp(runSessionAsync: (httpContext, mcpServer, cancellationToken) =>
|
||||
{
|
||||
mcpServer.RegisterNotificationHandler("test/notification", async (notification, cancellationToken) =>
|
||||
{
|
||||
Assert.Equal("Hello from client!", notification.Params?["message"]?.GetValue<string>());
|
||||
await mcpServer.SendNotificationAsync("test/notification", new { message = "Hello from server!" }, cancellationToken: cancellationToken);
|
||||
});
|
||||
return mcpServer.RunAsync(cancellationToken);
|
||||
});
|
||||
await app.StartAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
using var httpClient = CreateHttpClient();
|
||||
await using var mcpClient = await ConnectMcpClient(httpClient);
|
||||
|
||||
mcpClient.RegisterNotificationHandler("test/notification", (args, ca) =>
|
||||
{
|
||||
var msg = args.Params?["message"]?.GetValue<string>();
|
||||
receivedNotification.SetResult(msg);
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
|
||||
// Send a test message through POST endpoint
|
||||
await mcpClient.SendNotificationAsync("test/notification", new { message = "Hello from client!" }, cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
||||
var message = await receivedNotification.Task.WaitAsync(TimeSpan.FromSeconds(10), TestContext.Current.CancellationToken);
|
||||
Assert.Equal("Hello from server!", message);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AddMcpServer_CanBeCalled_MultipleTimes()
|
||||
{
|
||||
var firstOptionsCallbackCallCount = 0;
|
||||
var secondOptionsCallbackCallCount = 0;
|
||||
|
||||
Builder.Services.AddMcpServer(options =>
|
||||
{
|
||||
Interlocked.Increment(ref firstOptionsCallbackCallCount);
|
||||
})
|
||||
.WithTools<EchoTool>();
|
||||
|
||||
Builder.Services.AddMcpServer(options =>
|
||||
{
|
||||
Interlocked.Increment(ref secondOptionsCallbackCallCount);
|
||||
})
|
||||
.WithTools<SampleLlmTool>();
|
||||
|
||||
|
||||
await using var app = Builder.Build();
|
||||
app.MapMcp();
|
||||
await app.StartAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
using var httpClient = CreateHttpClient();
|
||||
await using var mcpClient = await ConnectMcpClient(httpClient);
|
||||
|
||||
// Options can be lazily initialized, but they must be instantiated by the time an MCP client can finish connecting.
|
||||
// Callbacks can be called multiple times if configureOptionsAsync is configured, because that uses the IOptionsFactory,
|
||||
// but that's not the case in this test.
|
||||
Assert.Equal(1, firstOptionsCallbackCallCount);
|
||||
Assert.Equal(1, secondOptionsCallbackCallCount);
|
||||
|
||||
var tools = await mcpClient.ListToolsAsync(cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
||||
Assert.Equal(2, tools.Count);
|
||||
Assert.Contains(tools, tools => tools.Name == "Echo");
|
||||
Assert.Contains(tools, tools => tools.Name == "sampleLLM");
|
||||
|
||||
var echoResponse = await mcpClient.CallToolAsync(
|
||||
"Echo",
|
||||
new Dictionary<string, object?>
|
||||
{
|
||||
["message"] = "from client!"
|
||||
},
|
||||
cancellationToken: TestContext.Current.CancellationToken);
|
||||
var textContent = Assert.Single(echoResponse.Content, c => c.Type == "text");
|
||||
|
||||
Assert.Equal("hello from client!", textContent.Text);
|
||||
}
|
||||
|
||||
private static void MapAbsoluteEndpointUriMcp(IEndpointRouteBuilder endpoints)
|
||||
{
|
||||
var loggerFactory = endpoints.ServiceProvider.GetRequiredService<ILoggerFactory>();
|
||||
var optionsSnapshot = endpoints.ServiceProvider.GetRequiredService<IOptions<McpServerOptions>>();
|
||||
|
||||
var routeGroup = endpoints.MapGroup("");
|
||||
SseResponseStreamTransport? session = null;
|
||||
|
||||
routeGroup.MapGet("/sse", async context =>
|
||||
{
|
||||
var response = context.Response;
|
||||
var requestAborted = context.RequestAborted;
|
||||
|
||||
response.Headers.ContentType = "text/event-stream";
|
||||
|
||||
await using var transport = new SseResponseStreamTransport(response.Body, "http://localhost/message");
|
||||
session = transport;
|
||||
|
||||
try
|
||||
{
|
||||
var transportTask = transport.RunAsync(cancellationToken: requestAborted);
|
||||
await using var server = McpServerFactory.Create(transport, optionsSnapshot.Value, loggerFactory, endpoints.ServiceProvider);
|
||||
|
||||
try
|
||||
{
|
||||
await server.RunAsync(requestAborted);
|
||||
}
|
||||
finally
|
||||
{
|
||||
await transport.DisposeAsync();
|
||||
await transportTask;
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException) when (requestAborted.IsCancellationRequested)
|
||||
{
|
||||
// RequestAborted always triggers when the client disconnects before a complete response body is written,
|
||||
// but this is how SSE connections are typically closed.
|
||||
}
|
||||
});
|
||||
|
||||
routeGroup.MapPost("/message", async context =>
|
||||
{
|
||||
if (session is null)
|
||||
{
|
||||
await Results.BadRequest("Session not started.").ExecuteAsync(context);
|
||||
return;
|
||||
}
|
||||
var message = (IJsonRpcMessage?)await context.Request.ReadFromJsonAsync(McpJsonUtilities.DefaultOptions.GetTypeInfo(typeof(IJsonRpcMessage)), context.RequestAborted);
|
||||
if (message is null)
|
||||
{
|
||||
await Results.BadRequest("No message in request body.").ExecuteAsync(context);
|
||||
return;
|
||||
}
|
||||
|
||||
await session.OnMessageReceivedAsync(message, context.RequestAborted);
|
||||
context.Response.StatusCode = StatusCodes.Status202Accepted;
|
||||
await context.Response.WriteAsync("Accepted");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
using Microsoft.Extensions.Logging;
|
||||
using ModelContextProtocol.Client;
|
||||
using ModelContextProtocol.Protocol.Transport;
|
||||
using ModelContextProtocol.Test.Utils;
|
||||
using ModelContextProtocol.Tests.Utils;
|
||||
using ModelContextProtocol.TestSseServer;
|
||||
|
||||
namespace ModelContextProtocol.Tests;
|
||||
|
||||
public class SseServerIntegrationTestFixture : IAsyncDisposable
|
||||
{
|
||||
private readonly KestrelInMemoryTransport _inMemoryTransport = new();
|
||||
|
||||
private readonly Task _serverTask;
|
||||
private readonly CancellationTokenSource _stopCts = new();
|
||||
|
||||
// XUnit's ITestOutputHelper is created per test, while this fixture is used for
|
||||
// multiple tests, so this dispatches the output to the current test.
|
||||
private readonly DelegatingTestOutputHelper _delegatingTestOutputHelper = new();
|
||||
|
||||
private SseClientTransportOptions DefaultTransportOptions { get; } = new()
|
||||
{
|
||||
Endpoint = new Uri("http://localhost/sse"),
|
||||
Name = "TestServer",
|
||||
};
|
||||
|
||||
public SseServerIntegrationTestFixture()
|
||||
{
|
||||
var socketsHttpHandler = new SocketsHttpHandler()
|
||||
{
|
||||
ConnectCallback = (context, token) =>
|
||||
{
|
||||
var connection = _inMemoryTransport.CreateConnection();
|
||||
return new(connection.ClientStream);
|
||||
},
|
||||
};
|
||||
|
||||
HttpClient = new HttpClient(socketsHttpHandler)
|
||||
{
|
||||
BaseAddress = DefaultTransportOptions.Endpoint,
|
||||
};
|
||||
_serverTask = Program.MainAsync([], new XunitLoggerProvider(_delegatingTestOutputHelper), _inMemoryTransport, _stopCts.Token);
|
||||
}
|
||||
|
||||
public HttpClient HttpClient { get; }
|
||||
|
||||
public Task<IMcpClient> ConnectMcpClientAsync(McpClientOptions? options, ILoggerFactory loggerFactory)
|
||||
{
|
||||
return McpClientFactory.CreateAsync(
|
||||
new SseClientTransport(DefaultTransportOptions, HttpClient, loggerFactory),
|
||||
options,
|
||||
loggerFactory,
|
||||
TestContext.Current.CancellationToken);
|
||||
}
|
||||
|
||||
public void Initialize(ITestOutputHelper output)
|
||||
{
|
||||
_delegatingTestOutputHelper.CurrentTestOutputHelper = output;
|
||||
}
|
||||
|
||||
public void TestCompleted()
|
||||
{
|
||||
_delegatingTestOutputHelper.CurrentTestOutputHelper = null;
|
||||
}
|
||||
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
_delegatingTestOutputHelper.CurrentTestOutputHelper = null;
|
||||
|
||||
HttpClient.Dispose();
|
||||
_stopCts.Cancel();
|
||||
|
||||
try
|
||||
{
|
||||
await _serverTask.ConfigureAwait(false);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
}
|
||||
|
||||
_stopCts.Dispose();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,325 @@
|
|||
using ModelContextProtocol.Client;
|
||||
using ModelContextProtocol.Protocol.Types;
|
||||
using ModelContextProtocol.Tests.Utils;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
namespace ModelContextProtocol.Tests;
|
||||
|
||||
public class SseServerIntegrationTests : LoggedTest, IClassFixture<SseServerIntegrationTestFixture>
|
||||
{
|
||||
private readonly SseServerIntegrationTestFixture _fixture;
|
||||
|
||||
public SseServerIntegrationTests(SseServerIntegrationTestFixture fixture, ITestOutputHelper testOutputHelper)
|
||||
: base(testOutputHelper)
|
||||
{
|
||||
_fixture = fixture;
|
||||
_fixture.Initialize(testOutputHelper);
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
_fixture.TestCompleted();
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
private Task<IMcpClient> GetClientAsync(McpClientOptions? options = null)
|
||||
{
|
||||
return _fixture.ConnectMcpClientAsync(options, LoggerFactory);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ConnectAndPing_Sse_TestServer()
|
||||
{
|
||||
// Arrange
|
||||
|
||||
// Act
|
||||
await using var client = await GetClientAsync();
|
||||
await client.PingAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(client);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Connect_TestServer_ShouldProvideServerFields()
|
||||
{
|
||||
// Arrange
|
||||
|
||||
// Act
|
||||
await using var client = await GetClientAsync();
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(client.ServerCapabilities);
|
||||
Assert.NotNull(client.ServerInfo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ListTools_Sse_TestServer()
|
||||
{
|
||||
// arrange
|
||||
|
||||
// act
|
||||
await using var client = await GetClientAsync();
|
||||
var tools = await client.ListToolsAsync(cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
||||
// assert
|
||||
Assert.NotNull(tools);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CallTool_Sse_EchoServer()
|
||||
{
|
||||
// arrange
|
||||
|
||||
// act
|
||||
await using var client = await GetClientAsync();
|
||||
var result = await client.CallToolAsync(
|
||||
"echo",
|
||||
new Dictionary<string, object?>
|
||||
{
|
||||
["message"] = "Hello MCP!"
|
||||
},
|
||||
cancellationToken: TestContext.Current.CancellationToken
|
||||
);
|
||||
|
||||
// assert
|
||||
Assert.NotNull(result);
|
||||
Assert.False(result.IsError);
|
||||
var textContent = Assert.Single(result.Content, c => c.Type == "text");
|
||||
Assert.Equal("Echo: Hello MCP!", textContent.Text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ListResources_Sse_TestServer()
|
||||
{
|
||||
// arrange
|
||||
|
||||
// act
|
||||
await using var client = await GetClientAsync();
|
||||
|
||||
IList<Resource> allResources = await client.ListResourcesAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
// The everything server provides 100 test resources
|
||||
Assert.Equal(100, allResources.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ReadResource_Sse_TextResource()
|
||||
{
|
||||
// arrange
|
||||
|
||||
// act
|
||||
await using var client = await GetClientAsync();
|
||||
// Odd numbered resources are text in the everything server (despite the docs saying otherwise)
|
||||
// 1 is index 0, which is "even" in the 0-based index
|
||||
// We copied this oddity to the test server
|
||||
var result = await client.ReadResourceAsync("test://static/resource/1", TestContext.Current.CancellationToken);
|
||||
|
||||
Assert.NotNull(result);
|
||||
Assert.Single(result.Contents);
|
||||
|
||||
TextResourceContents textContent = Assert.IsType<TextResourceContents>(result.Contents[0]);
|
||||
Assert.NotNull(textContent.Text);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ReadResource_Sse_BinaryResource()
|
||||
{
|
||||
// arrange
|
||||
|
||||
// act
|
||||
await using var client = await GetClientAsync();
|
||||
// Even numbered resources are binary in the everything server (despite the docs saying otherwise)
|
||||
// 2 is index 1, which is "odd" in the 0-based index
|
||||
// We copied this oddity to the test server
|
||||
var result = await client.ReadResourceAsync("test://static/resource/2", TestContext.Current.CancellationToken);
|
||||
|
||||
Assert.NotNull(result);
|
||||
Assert.Single(result.Contents);
|
||||
|
||||
BlobResourceContents blobContent = Assert.IsType<BlobResourceContents>(result.Contents[0]);
|
||||
Assert.NotNull(blobContent.Blob);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ListPrompts_Sse_TestServer()
|
||||
{
|
||||
// arrange
|
||||
|
||||
// act
|
||||
await using var client = await GetClientAsync();
|
||||
var prompts = await client.ListPromptsAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
// assert
|
||||
Assert.NotNull(prompts);
|
||||
Assert.NotEmpty(prompts);
|
||||
// We could add specific assertions for the known prompts
|
||||
Assert.Contains(prompts, p => p.Name == "simple_prompt");
|
||||
Assert.Contains(prompts, p => p.Name == "complex_prompt");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetPrompt_Sse_SimplePrompt()
|
||||
{
|
||||
// arrange
|
||||
|
||||
// act
|
||||
await using var client = await GetClientAsync();
|
||||
var result = await client.GetPromptAsync("simple_prompt", null, cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
||||
// assert
|
||||
Assert.NotNull(result);
|
||||
Assert.NotEmpty(result.Messages);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetPrompt_Sse_ComplexPrompt()
|
||||
{
|
||||
// arrange
|
||||
|
||||
// act
|
||||
await using var client = await GetClientAsync();
|
||||
var arguments = new Dictionary<string, object?>
|
||||
{
|
||||
{ "temperature", "0.7" },
|
||||
{ "style", "formal" }
|
||||
};
|
||||
var result = await client.GetPromptAsync("complex_prompt", arguments, cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
||||
// assert
|
||||
Assert.NotNull(result);
|
||||
Assert.NotEmpty(result.Messages);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetPrompt_Sse_NonExistent_ThrowsException()
|
||||
{
|
||||
// arrange
|
||||
|
||||
// act
|
||||
await using var client = await GetClientAsync();
|
||||
await Assert.ThrowsAsync<McpException>(() =>
|
||||
client.GetPromptAsync("non_existent_prompt", null, cancellationToken: TestContext.Current.CancellationToken));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Sampling_Sse_TestServer()
|
||||
{
|
||||
// arrange
|
||||
// Set up the sampling handler
|
||||
int samplingHandlerCalls = 0;
|
||||
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
|
||||
McpClientOptions options = new();
|
||||
options.Capabilities = new();
|
||||
options.Capabilities.Sampling ??= new();
|
||||
options.Capabilities.Sampling.SamplingHandler = async (_, _, _) =>
|
||||
{
|
||||
samplingHandlerCalls++;
|
||||
return new CreateMessageResult
|
||||
{
|
||||
Model = "test-model",
|
||||
Role = "assistant",
|
||||
Content = new Content
|
||||
{
|
||||
Type = "text",
|
||||
Text = "Test response"
|
||||
}
|
||||
};
|
||||
};
|
||||
await using var client = await GetClientAsync(options);
|
||||
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
|
||||
|
||||
// Call the server's sampleLLM tool which should trigger our sampling handler
|
||||
var result = await client.CallToolAsync("sampleLLM", new Dictionary<string, object?>
|
||||
{
|
||||
["prompt"] = "Test prompt",
|
||||
["maxTokens"] = 100
|
||||
},
|
||||
cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
||||
// assert
|
||||
Assert.NotNull(result);
|
||||
var textContent = Assert.Single(result.Content);
|
||||
Assert.Equal("text", textContent.Type);
|
||||
Assert.False(string.IsNullOrEmpty(textContent.Text));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task CallTool_Sse_EchoServer_Concurrently()
|
||||
{
|
||||
await using var client1 = await GetClientAsync();
|
||||
await using var client2 = await GetClientAsync();
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
var client = (i % 2 == 0) ? client1 : client2;
|
||||
var result = await client.CallToolAsync(
|
||||
"echo",
|
||||
new Dictionary<string, object?>
|
||||
{
|
||||
["message"] = $"Hello MCP! {i}"
|
||||
},
|
||||
cancellationToken: TestContext.Current.CancellationToken
|
||||
);
|
||||
|
||||
Assert.NotNull(result);
|
||||
Assert.False(result.IsError);
|
||||
var textContent = Assert.Single(result.Content, c => c.Type == "text");
|
||||
Assert.Equal($"Echo: Hello MCP! {i}", textContent.Text);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EventSourceResponse_Includes_ExpectedHeaders()
|
||||
{
|
||||
using var sseResponse = await _fixture.HttpClient.GetAsync("", HttpCompletionOption.ResponseHeadersRead, TestContext.Current.CancellationToken);
|
||||
|
||||
sseResponse.EnsureSuccessStatusCode();
|
||||
|
||||
Assert.Equal("text/event-stream", sseResponse.Content.Headers.ContentType?.MediaType);
|
||||
Assert.Equal("identity", sseResponse.Content.Headers.ContentEncoding.ToString());
|
||||
Assert.NotNull(sseResponse.Headers.CacheControl);
|
||||
Assert.True(sseResponse.Headers.CacheControl.NoStore);
|
||||
Assert.True(sseResponse.Headers.CacheControl.NoCache);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EventSourceStream_Includes_MessageEventType()
|
||||
{
|
||||
// Simulate our own MCP client handshake using a plain HttpClient so we can look for "event: message"
|
||||
// in the raw SSE response stream which is not exposed by the real MCP client.
|
||||
await using var sseResponse = await _fixture.HttpClient.GetStreamAsync("", TestContext.Current.CancellationToken);
|
||||
using var streamReader = new StreamReader(sseResponse);
|
||||
|
||||
var endpointEvent = await streamReader.ReadLineAsync(TestContext.Current.CancellationToken);
|
||||
Assert.Equal("event: endpoint", endpointEvent);
|
||||
|
||||
var endpointData = await streamReader.ReadLineAsync(TestContext.Current.CancellationToken);
|
||||
Assert.NotNull(endpointData);
|
||||
Assert.StartsWith("data: ", endpointData);
|
||||
var messageEndpoint = endpointData["data: ".Length..];
|
||||
|
||||
const string initializeRequest = """
|
||||
{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"IntegrationTestClient","version":"1.0.0"}}}
|
||||
""";
|
||||
using (var initializeRequestBody = new StringContent(initializeRequest, Encoding.UTF8, "application/json"))
|
||||
{
|
||||
var response = await _fixture.HttpClient.PostAsync(messageEndpoint, initializeRequestBody, TestContext.Current.CancellationToken);
|
||||
Assert.Equal(HttpStatusCode.Accepted, response.StatusCode);
|
||||
}
|
||||
|
||||
const string initializedNotification = """
|
||||
{"jsonrpc":"2.0","method":"notifications/initialized"}
|
||||
""";
|
||||
using (var initializedNotificationBody = new StringContent(initializedNotification, Encoding.UTF8, "application/json"))
|
||||
{
|
||||
var response = await _fixture.HttpClient.PostAsync(messageEndpoint, initializedNotificationBody, TestContext.Current.CancellationToken);
|
||||
Assert.Equal(HttpStatusCode.Accepted, response.StatusCode);
|
||||
}
|
||||
|
||||
Assert.Equal("", await streamReader.ReadLineAsync(TestContext.Current.CancellationToken));
|
||||
var messageEvent = await streamReader.ReadLineAsync(TestContext.Current.CancellationToken);
|
||||
Assert.Equal("event: message", messageEvent);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
namespace ModelContextProtocol.Tests.Utils;
|
||||
|
||||
public class DelegatingTestOutputHelper : ITestOutputHelper
|
||||
{
|
||||
public ITestOutputHelper? CurrentTestOutputHelper { get; set; }
|
||||
|
||||
public string Output => CurrentTestOutputHelper?.Output ?? string.Empty;
|
||||
|
||||
public void Write(string message) => CurrentTestOutputHelper?.Write(message);
|
||||
public void Write(string format, params object[] args) => CurrentTestOutputHelper?.Write(format, args);
|
||||
public void WriteLine(string message) => CurrentTestOutputHelper?.WriteLine(message);
|
||||
public void WriteLine(string format, params object[] args) => CurrentTestOutputHelper?.WriteLine(format, args);
|
||||
}
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
using Microsoft.AspNetCore.Connections;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using System.IO.Pipelines;
|
||||
|
||||
namespace ModelContextProtocol.Tests.Utils;
|
||||
|
||||
public sealed class KestrelInMemoryConnection : ConnectionContext
|
||||
{
|
||||
private readonly Pipe _clientToServerPipe = new();
|
||||
private readonly Pipe _serverToClientPipe = new();
|
||||
private readonly CancellationTokenSource _connectionClosedCts = new();
|
||||
private readonly FeatureCollection _features = new();
|
||||
|
||||
public KestrelInMemoryConnection()
|
||||
{
|
||||
ConnectionClosed = _connectionClosedCts.Token;
|
||||
Transport = new DuplexPipe
|
||||
{
|
||||
Input = _clientToServerPipe.Reader,
|
||||
Output = _serverToClientPipe.Writer,
|
||||
};
|
||||
Application = new DuplexPipe
|
||||
{
|
||||
Input = _serverToClientPipe.Reader,
|
||||
Output = _clientToServerPipe.Writer,
|
||||
};
|
||||
ClientStream = new DuplexStream(Application, _connectionClosedCts);
|
||||
}
|
||||
|
||||
public IDuplexPipe Application { get; }
|
||||
public Stream ClientStream { get; }
|
||||
|
||||
public override IDuplexPipe Transport { get; set; }
|
||||
public override string ConnectionId { get; set; } = Guid.NewGuid().ToString("N");
|
||||
|
||||
public override IFeatureCollection Features => _features;
|
||||
|
||||
public override IDictionary<object, object?> Items { get; set; } = new Dictionary<object, object?>();
|
||||
|
||||
public override async ValueTask DisposeAsync()
|
||||
{
|
||||
// This is called by Kestrel. The client should dispose the DuplexStream which
|
||||
// completes the other half of these pipes.
|
||||
await _serverToClientPipe.Writer.CompleteAsync();
|
||||
await _serverToClientPipe.Reader.CompleteAsync();
|
||||
|
||||
// Don't bother disposing the _connectionClosedCts, since this is just for testing,
|
||||
// and it's annoying to synchronize with DuplexStream.
|
||||
|
||||
await base.DisposeAsync();
|
||||
}
|
||||
|
||||
private class DuplexPipe : IDuplexPipe
|
||||
{
|
||||
public required PipeReader Input { get; init; }
|
||||
public required PipeWriter Output { get; init; }
|
||||
}
|
||||
|
||||
private class DuplexStream(IDuplexPipe duplexPipe, CancellationTokenSource connectionClosedCts) : Stream
|
||||
{
|
||||
private readonly Stream _readStream = duplexPipe.Input.AsStream();
|
||||
private readonly Stream _writeStream = duplexPipe.Output.AsStream();
|
||||
|
||||
public override bool CanRead => true;
|
||||
public override bool CanWrite => true;
|
||||
public override bool CanSeek => false;
|
||||
|
||||
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||
=> _readStream.ReadAsync(buffer, offset, count, cancellationToken);
|
||||
public override ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken cancellationToken = default)
|
||||
=> _readStream.ReadAsync(buffer, cancellationToken);
|
||||
|
||||
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||
=> _writeStream.WriteAsync(buffer, offset, count, cancellationToken);
|
||||
public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken = default)
|
||||
=> _writeStream.WriteAsync(buffer, cancellationToken);
|
||||
|
||||
public override Task FlushAsync(CancellationToken cancellationToken)
|
||||
=> _writeStream.FlushAsync(cancellationToken);
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
// Signal to the server the the client has closed the connection, and dispose the client-half of the Pipes.
|
||||
connectionClosedCts.Cancel();
|
||||
duplexPipe.Input.Complete();
|
||||
duplexPipe.Output.Complete();
|
||||
}
|
||||
|
||||
// Unsupported stuff
|
||||
public override long Length => throw new NotSupportedException();
|
||||
|
||||
public override long Position
|
||||
{
|
||||
get => throw new NotSupportedException();
|
||||
set => throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
// Don't bother supporting sync or APM methods. SocketsHttpHandler shouldn't use them.
|
||||
public override int Read(byte[] buffer, int offset, int count) => throw new NotSupportedException();
|
||||
public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException();
|
||||
public override void Flush() => throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Connections;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
|
||||
namespace ModelContextProtocol.Tests.Utils;
|
||||
|
||||
public class KestrelInMemoryTest : LoggedTest
|
||||
{
|
||||
private readonly KestrelInMemoryTransport _inMemoryTransport = new();
|
||||
|
||||
public KestrelInMemoryTest(ITestOutputHelper testOutputHelper)
|
||||
: base(testOutputHelper)
|
||||
{
|
||||
// Use SlimBuilder instead of EmptyBuilder to avoid having to call UseRouting() and UseEndpoints(_ => { })
|
||||
// or a helper that does the same every test. But clear out the existing socket transport to avoid potential port conflicts.
|
||||
Builder = WebApplication.CreateSlimBuilder();
|
||||
Builder.Services.RemoveAll<IConnectionListenerFactory>();
|
||||
Builder.Services.AddSingleton<IConnectionListenerFactory>(_inMemoryTransport);
|
||||
Builder.Services.AddSingleton(LoggerProvider);
|
||||
}
|
||||
|
||||
public WebApplicationBuilder Builder { get; }
|
||||
|
||||
public HttpClient CreateHttpClient()
|
||||
{
|
||||
var socketsHttpHandler = new SocketsHttpHandler()
|
||||
{
|
||||
ConnectCallback = (context, token) =>
|
||||
{
|
||||
var connection = _inMemoryTransport.CreateConnection();
|
||||
return new(connection.ClientStream);
|
||||
},
|
||||
};
|
||||
|
||||
return new HttpClient(socketsHttpHandler);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
using Microsoft.AspNetCore.Connections;
|
||||
using System.Net;
|
||||
using System.Threading.Channels;
|
||||
|
||||
namespace ModelContextProtocol.Tests.Utils;
|
||||
|
||||
public sealed class KestrelInMemoryTransport : IConnectionListenerFactory, IConnectionListener
|
||||
{
|
||||
private readonly Channel<ConnectionContext> _acceptQueue = Channel.CreateUnbounded<ConnectionContext>();
|
||||
private EndPoint? _endPoint;
|
||||
|
||||
public EndPoint EndPoint => _endPoint ?? throw new InvalidOperationException("EndPoint is not set. Call BindAsync first.");
|
||||
|
||||
public KestrelInMemoryConnection CreateConnection()
|
||||
{
|
||||
var connection = new KestrelInMemoryConnection();
|
||||
_acceptQueue.Writer.TryWrite(connection);
|
||||
return connection;
|
||||
}
|
||||
|
||||
public async ValueTask<ConnectionContext?> AcceptAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (await _acceptQueue.Reader.WaitToReadAsync(cancellationToken))
|
||||
{
|
||||
while (_acceptQueue.Reader.TryRead(out var item))
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ValueTask<IConnectionListener> BindAsync(EndPoint endpoint, CancellationToken cancellationToken = default)
|
||||
{
|
||||
_endPoint = endpoint;
|
||||
return new ValueTask<IConnectionListener>(this);
|
||||
}
|
||||
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
return UnbindAsync(default);
|
||||
}
|
||||
|
||||
public ValueTask UnbindAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
_acceptQueue.Writer.TryComplete();
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
using Microsoft.Extensions.Logging;
|
||||
using ModelContextProtocol.Test.Utils;
|
||||
|
||||
namespace ModelContextProtocol.Tests.Utils;
|
||||
|
||||
public class LoggedTest : IDisposable
|
||||
{
|
||||
private readonly DelegatingTestOutputHelper _delegatingTestOutputHelper;
|
||||
|
||||
public LoggedTest(ITestOutputHelper testOutputHelper)
|
||||
{
|
||||
_delegatingTestOutputHelper = new()
|
||||
{
|
||||
CurrentTestOutputHelper = testOutputHelper,
|
||||
};
|
||||
LoggerProvider = new XunitLoggerProvider(_delegatingTestOutputHelper);
|
||||
LoggerFactory = Microsoft.Extensions.Logging.LoggerFactory.Create(builder =>
|
||||
{
|
||||
builder.AddProvider(LoggerProvider);
|
||||
});
|
||||
}
|
||||
|
||||
public ITestOutputHelper TestOutputHelper => _delegatingTestOutputHelper;
|
||||
public ILoggerFactory LoggerFactory { get; }
|
||||
public ILoggerProvider LoggerProvider { get; }
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
_delegatingTestOutputHelper.CurrentTestOutputHelper = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
namespace ModelContextProtocol.Tests.Utils;
|
||||
|
||||
public class MockHttpHandler : HttpMessageHandler
|
||||
{
|
||||
public Func<HttpRequestMessage, Task<HttpResponseMessage>>? RequestHandler { get; set; }
|
||||
|
||||
protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (RequestHandler == null)
|
||||
throw new InvalidOperationException($"No {nameof(RequestHandler)} was set! Please set handler first and make request afterwards.");
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var result = await RequestHandler.Invoke(request);
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
using ModelContextProtocol.Protocol.Messages;
|
||||
using ModelContextProtocol.Protocol.Transport;
|
||||
using ModelContextProtocol.Protocol.Types;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Channels;
|
||||
|
||||
namespace ModelContextProtocol.Tests.Utils;
|
||||
|
||||
public class TestServerTransport : ITransport
|
||||
{
|
||||
private readonly Channel<IJsonRpcMessage> _messageChannel;
|
||||
|
||||
public bool IsConnected { get; set; }
|
||||
|
||||
public ChannelReader<IJsonRpcMessage> MessageReader => _messageChannel;
|
||||
|
||||
public List<IJsonRpcMessage> SentMessages { get; } = [];
|
||||
|
||||
public Action<IJsonRpcMessage>? OnMessageSent { get; set; }
|
||||
|
||||
public TestServerTransport()
|
||||
{
|
||||
_messageChannel = Channel.CreateUnbounded<IJsonRpcMessage>(new UnboundedChannelOptions
|
||||
{
|
||||
SingleReader = true,
|
||||
SingleWriter = true,
|
||||
});
|
||||
IsConnected = true;
|
||||
}
|
||||
|
||||
public ValueTask DisposeAsync()
|
||||
{
|
||||
_messageChannel.Writer.TryComplete();
|
||||
IsConnected = false;
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task SendMessageAsync(IJsonRpcMessage message, CancellationToken cancellationToken = default)
|
||||
{
|
||||
SentMessages.Add(message);
|
||||
if (message is JsonRpcRequest request)
|
||||
{
|
||||
if (request.Method == RequestMethods.RootsList)
|
||||
await ListRoots(request, cancellationToken);
|
||||
else if (request.Method == RequestMethods.SamplingCreateMessage)
|
||||
await Sampling(request, cancellationToken);
|
||||
else
|
||||
await WriteMessageAsync(request, cancellationToken);
|
||||
}
|
||||
else if (message is JsonRpcNotification notification)
|
||||
{
|
||||
await WriteMessageAsync(notification, cancellationToken);
|
||||
}
|
||||
|
||||
OnMessageSent?.Invoke(message);
|
||||
}
|
||||
|
||||
private async Task ListRoots(JsonRpcRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
await WriteMessageAsync(new JsonRpcResponse
|
||||
{
|
||||
Id = request.Id,
|
||||
Result = JsonSerializer.SerializeToNode(new ListRootsResult
|
||||
{
|
||||
Roots = []
|
||||
}),
|
||||
}, cancellationToken);
|
||||
}
|
||||
|
||||
private async Task Sampling(JsonRpcRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
await WriteMessageAsync(new JsonRpcResponse
|
||||
{
|
||||
Id = request.Id,
|
||||
Result = JsonSerializer.SerializeToNode(new CreateMessageResult { Content = new(), Model = "model", Role = "role" }),
|
||||
}, cancellationToken);
|
||||
}
|
||||
|
||||
private async Task WriteMessageAsync(IJsonRpcMessage message, CancellationToken cancellationToken = default)
|
||||
{
|
||||
await _messageChannel.Writer.WriteAsync(message, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
using System.Globalization;
|
||||
using System.Text;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace ModelContextProtocol.Test.Utils;
|
||||
|
||||
public class XunitLoggerProvider(ITestOutputHelper output) : ILoggerProvider
|
||||
{
|
||||
public ILogger CreateLogger(string categoryName)
|
||||
{
|
||||
return new XunitLogger(output, categoryName);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
private class XunitLogger(ITestOutputHelper output, string category) : ILogger
|
||||
{
|
||||
public void Log<TState>(
|
||||
LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
var timestamp = DateTimeOffset.UtcNow.ToString("s", CultureInfo.InvariantCulture);
|
||||
var prefix = $"| [{timestamp}] {category} {logLevel}: ";
|
||||
var lines = formatter(state, exception);
|
||||
sb.Append(prefix);
|
||||
sb.Append(lines);
|
||||
|
||||
if (exception is not null)
|
||||
{
|
||||
sb.AppendLine();
|
||||
sb.Append(exception.ToString());
|
||||
}
|
||||
|
||||
output.WriteLine(sb.ToString());
|
||||
}
|
||||
|
||||
public bool IsEnabled(LogLevel logLevel) => true;
|
||||
|
||||
public IDisposable BeginScope<TState>(TState state) where TState : notnull
|
||||
=> new NoopDisposable();
|
||||
|
||||
private sealed class NoopDisposable : IDisposable
|
||||
{
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue