Skip to content

Commit b3c918e

Browse files
committed
Fix tests
1 parent 84c29bf commit b3c918e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Servers/HttpSys/test/FunctionalTests/HttpsTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,13 @@ public async Task Https_SendHelloWorld_Success()
5050
[ConditionalFact]
5151
public async Task Https_EchoHelloWorld_Success()
5252
{
53-
using (Utilities.CreateDynamicHttpsServer(out var address, httpContext =>
53+
using (Utilities.CreateDynamicHttpsServer(out var address, async httpContext =>
5454
{
55-
string input = new StreamReader(httpContext.Request.Body).ReadToEnd();
55+
var input = await new StreamReader(httpContext.Request.Body).ReadToEndAsync();
5656
Assert.Equal("Hello World", input);
57-
byte[] body = Encoding.UTF8.GetBytes("Hello World");
57+
var body = Encoding.UTF8.GetBytes("Hello World");
5858
httpContext.Response.ContentLength = body.Length;
59-
httpContext.Response.Body.Write(body, 0, body.Length);
60-
return Task.FromResult(0);
59+
await httpContext.Response.Body.WriteAsync(body, 0, body.Length);
6160
}))
6261
{
6362
string response = await SendRequestAsync(address, "Hello World");

src/Servers/Kestrel/test/InMemory.FunctionalTests/UpgradeTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public async Task ResponseThrowsAfterUpgrade()
3333
{
3434
await writer.WriteLineAsync("New protocol data");
3535
await writer.FlushAsync();
36+
await writer.DisposeAsync();
3637
}
3738

3839
upgrade.TrySetResult(true);
@@ -79,6 +80,7 @@ public async Task RequestBodyAlwaysEmptyAfterUpgrade()
7980
Assert.Equal(send, line);
8081
await writer.WriteLineAsync(recv);
8182
await writer.FlushAsync();
83+
await writer.DisposeAsync();
8284
}
8385

8486
upgrade.TrySetResult(true);

0 commit comments

Comments
 (0)