Support progress notifications with McpClientTool and McpClientExtensions.CallToolAsync (#312)

This commit is contained in:
Stephen Toub 2025-04-16 09:03:07 -04:00 • committed by GitHub
commit 227f440ab9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,7 +33,7 @@ public class CancellationTests : ClientServerTestBase
[Fact]
public async Task PrecancelRequest_CancelsBeforeSending()
{
var client = await CreateMcpClientForServer();
await using var client = await CreateMcpClientForServer();
bool gotCancellation = false;
await using (Server.RegisterNotificationHandler(NotificationMethods.CancelledNotification, (notification, cancellationToken) =>
@ -51,7 +51,7 @@ public class CancellationTests : ClientServerTestBase
[Fact]
public async Task CancellationPropagation_RequestingCancellationCancelsPendingRequest()
{
var client = await CreateMcpClientForServer();
await using var client = await CreateMcpClientForServer();
var tools = await client.ListToolsAsync(cancellationToken: TestContext.Current.CancellationToken);
var waitTool = tools.First(t => t.Name == nameof(WaitForCancellation));