Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tratcher committed Feb 14, 2019
1 parent 7ade519 commit 9c8ff98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Servers/HttpSys/test/FunctionalTests/HttpsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ public async Task Https_SendHelloWorld_Success()
[ConditionalFact]
public async Task Https_EchoHelloWorld_Success()
{
using (Utilities.CreateDynamicHttpsServer(out var address, httpContext =>
using (Utilities.CreateDynamicHttpsServer(out var address, async httpContext =>
{
string input = new StreamReader(httpContext.Request.Body).ReadToEnd();
var input = await new StreamReader(httpContext.Request.Body).ReadToEndAsync();
Assert.Equal("Hello World", input);
byte[] body = Encoding.UTF8.GetBytes("Hello World");
var body = Encoding.UTF8.GetBytes("Hello World");
httpContext.Response.ContentLength = body.Length;
httpContext.Response.Body.Write(body, 0, body.Length);
return Task.FromResult(0);
await httpContext.Response.Body.WriteAsync(body, 0, body.Length);
}))
{
string response = await SendRequestAsync(address, "Hello World");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public async Task ResponseThrowsAfterUpgrade()
{
await writer.WriteLineAsync("New protocol data");
await writer.FlushAsync();
await writer.DisposeAsync();
}
upgrade.TrySetResult(true);
Expand Down Expand Up @@ -79,6 +80,7 @@ public async Task RequestBodyAlwaysEmptyAfterUpgrade()
Assert.Equal(send, line);
await writer.WriteLineAsync(recv);
await writer.FlushAsync();
await writer.DisposeAsync();
}
upgrade.TrySetResult(true);
Expand Down

0 comments on commit 9c8ff98

Please sign in to comment.