Add client completion notification and details (#1368)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Stephen Toub 2026-03-02 09:17:22 -05:00 • committed by GitHub
commit b965a7eca6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -303,4 +303,19 @@ public abstract class HttpServerIntegrationTests : LoggedTest, IClassFixture<Sse
Assert.Equal($"Echo: Hello MCP! {i}", textContent.Text);
}
}
[Fact]
public async Task Completion_GracefulDisposal_ReturnsCompletionDetails()
{
var client = await GetClientAsync();
Assert.False(client.Completion.IsCompleted);
await client.DisposeAsync();
Assert.True(client.Completion.IsCompleted);
var details = await client.Completion;
var httpDetails = Assert.IsType<HttpClientCompletionDetails>(details);
Assert.Null(httpDetails.Exception);
Assert.Null(httpDetails.HttpStatusCode);
}
}