Skip to content

Commit 0b46bf4

Browse files
Copilothalter73
andcommitted
Address code review feedback: improve variable naming and use ReadAsByteArrayAsync
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
1 parent b8f727d commit 0b46bf4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/ModelContextProtocol.AspNetCore.Tests/StreamableHttpServerConformanceTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ Task<HttpResponseMessage> CallLongRunningToolAsync() =>
367367
var getResponse = await HttpClient.GetAsync("", HttpCompletionOption.ResponseHeadersRead, TestContext.Current.CancellationToken);
368368

369369
// Wait for all long-running tool calls to receive 200 response headers before sending DELETE
370-
var longRunningToolResponses = await Task.WhenAll(longRunningToolTasks);
371-
foreach (var response in longRunningToolResponses)
370+
var responseHeaders = await Task.WhenAll(longRunningToolTasks);
371+
foreach (var response in responseHeaders)
372372
{
373373
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
374374
}
@@ -385,9 +385,9 @@ Task<HttpResponseMessage> CallLongRunningToolAsync() =>
385385
// the connection without writing the chunk terminator, causing an HttpRequestException when reading the response body.
386386
// The spec suggests sending CancelledNotifications. That would be good, but we can do that later.
387387
// For now, the important thing is that reading the response body fails.
388-
foreach (var response in longRunningToolResponses)
388+
foreach (var response in responseHeaders)
389389
{
390-
await Assert.ThrowsAsync<HttpRequestException>(async () => await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken));
390+
await Assert.ThrowsAsync<HttpRequestException>(async () => await response.Content.ReadAsByteArrayAsync(TestContext.Current.CancellationToken));
391391
}
392392
}
393393

0 commit comments

Comments
 (0)