File tree 2 files changed +6
-5
lines changed
HttpSys/test/FunctionalTests
Kestrel/test/InMemory.FunctionalTests
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,13 @@ public async Task Https_SendHelloWorld_Success()
50
50
[ ConditionalFact ]
51
51
public async Task Https_EchoHelloWorld_Success ( )
52
52
{
53
- using ( Utilities . CreateDynamicHttpsServer ( out var address , httpContext =>
53
+ using ( Utilities . CreateDynamicHttpsServer ( out var address , async httpContext =>
54
54
{
55
- string input = new StreamReader ( httpContext . Request . Body ) . ReadToEnd ( ) ;
55
+ var input = await new StreamReader ( httpContext . Request . Body ) . ReadToEndAsync ( ) ;
56
56
Assert . Equal ( "Hello World" , input ) ;
57
- byte [ ] body = Encoding . UTF8 . GetBytes ( "Hello World" ) ;
57
+ var body = Encoding . UTF8 . GetBytes ( "Hello World" ) ;
58
58
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 ) ;
61
60
} ) )
62
61
{
63
62
string response = await SendRequestAsync ( address , "Hello World" ) ;
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ public async Task ResponseThrowsAfterUpgrade()
33
33
{
34
34
await writer . WriteLineAsync ( "New protocol data" ) ;
35
35
await writer . FlushAsync ( ) ;
36
+ await writer . DisposeAsync ( ) ;
36
37
}
37
38
38
39
upgrade . TrySetResult ( true ) ;
@@ -79,6 +80,7 @@ public async Task RequestBodyAlwaysEmptyAfterUpgrade()
79
80
Assert . Equal ( send , line ) ;
80
81
await writer . WriteLineAsync ( recv ) ;
81
82
await writer . FlushAsync ( ) ;
83
+ await writer . DisposeAsync ( ) ;
82
84
}
83
85
84
86
upgrade . TrySetResult ( true ) ;
You can’t perform that action at this time.
0 commit comments