From 79175694660112f2b421912433aee5e5ff78d6fc Mon Sep 17 00:00:00 2001 From: Louis DeJardin Date: Wed, 16 Sep 2015 22:16:06 -0700 Subject: [PATCH] Changing chunked with exception test criteria --- .../ChunkedResponseTests.cs | 8 ++++++-- .../TestConnection.cs | 7 ++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/test/Microsoft.AspNet.Server.KestrelTests/ChunkedResponseTests.cs b/test/Microsoft.AspNet.Server.KestrelTests/ChunkedResponseTests.cs index 162a29263a..f7e4898cad 100644 --- a/test/Microsoft.AspNet.Server.KestrelTests/ChunkedResponseTests.cs +++ b/test/Microsoft.AspNet.Server.KestrelTests/ChunkedResponseTests.cs @@ -146,8 +146,12 @@ namespace Microsoft.AspNet.Server.KestrelTests "", ""); - // Nothing (not even headers) are written, but the connection is closed. - await connection.ReceiveEnd(); + // Headers are sent before connection is closed, but chunked body terminator isn't sent + await connection.ReceiveEnd( + "HTTP/1.1 200 OK", + "Transfer-Encoding: chunked", + "", + ""); } } } diff --git a/test/Microsoft.AspNet.Server.KestrelTests/TestConnection.cs b/test/Microsoft.AspNet.Server.KestrelTests/TestConnection.cs index 4afd1628d9..773bddf70d 100644 --- a/test/Microsoft.AspNet.Server.KestrelTests/TestConnection.cs +++ b/test/Microsoft.AspNet.Server.KestrelTests/TestConnection.cs @@ -119,9 +119,10 @@ namespace Microsoft.AspNet.Server.KestrelTests public async Task ReceiveEnd(params string[] lines) { await Receive(lines); - var ch = new char[1]; - var count = await _reader.ReadAsync(ch, 0, 1); - Assert.Equal(0, count); + var ch = new char[128]; + var count = await _reader.ReadAsync(ch, 0, 128); + var text = new string(ch, 0, count); + Assert.Equal("", text); } } } \ No newline at end of file