Changing chunked with exception test criteria

This commit is contained in:
Louis DeJardin 2015-09-16 22:16:06 -07:00
parent 52dc37eae7
commit 7917569466
2 changed files with 10 additions and 5 deletions

View File

@ -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",
"",
"");
}
}
}

View File

@ -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);
}
}
}