Add McpSessions.NegotiatedProtocolVersion property. (#794)
This commit is contained in:
parent
38b4a26998
commit
7cfe0ef621
1 changed files with 57 additions and 20 deletions
|
|
@ -171,13 +171,13 @@ public class MapMcpStreamableHttpTests(ITestOutputHelper outputHelper) : MapMcpT
|
|||
|
||||
await app.StartAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
await using (var mcpClient = await ConnectAsync(clientOptions: new()
|
||||
await using var mcpClient = await ConnectAsync(clientOptions: new()
|
||||
{
|
||||
ProtocolVersion = "2025-03-26",
|
||||
}))
|
||||
{
|
||||
await mcpClient.ListToolsAsync(cancellationToken: TestContext.Current.CancellationToken);
|
||||
}
|
||||
});
|
||||
|
||||
Assert.Equal("2025-03-26", mcpClient.NegotiatedProtocolVersion);
|
||||
await mcpClient.ListToolsAsync(cancellationToken: TestContext.Current.CancellationToken);
|
||||
|
||||
// The header should be included in the GET request, the initialized notification, the tools/list call, and the delete request.
|
||||
Assert.NotEmpty(protocolVersionHeaderValues);
|
||||
|
|
|
|||
Loading…
Reference in a new issue