Add new dependnecy and test for UTF-8 BOM fix in views

This commit is contained in:
Chris R 2016-09-21 16:03:04 -07:00
parent 3a868d87a2
commit 1b1bd34b8d
3 changed files with 6 additions and 3 deletions

View File

@ -43,6 +43,7 @@
}, },
"netstandard1.3": { "netstandard1.3": {
"dependencies": { "dependencies": {
"System.Text.Encoding.Extensions": "4.0.11-*",
"System.Threading": "4.0.11-*" "System.Threading": "4.0.11-*"
} }
} }

View File

@ -44,6 +44,7 @@
}, },
"netstandard1.3": { "netstandard1.3": {
"dependencies": { "dependencies": {
"System.Text.Encoding.Extensions": "4.0.11-*",
"System.Threading": "4.0.11-*" "System.Threading": "4.0.11-*"
} }
} }

View File

@ -20,13 +20,14 @@ namespace Microsoft.AspNetCore.Diagnostics.FunctionalTests
[Fact] [Fact]
public async Task WelcomePage_ShowsWelcome() public async Task WelcomePage_ShowsWelcome()
{ {
// Arrange
var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/"); var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/");
// Act
var response = await Client.SendAsync(request); var response = await Client.SendAsync(request);
// Assert var bytes = await response.Content.ReadAsByteArrayAsync();
Assert.True(bytes.Length > 1);
Assert.NotEqual(0xEF, bytes[0]); // No leading UTF-8 BOM
var body = await response.Content.ReadAsStringAsync(); var body = await response.Content.ReadAsStringAsync();
Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Assert.Contains("Your ASP.NET Core application has been successfully started", body); Assert.Contains("Your ASP.NET Core application has been successfully started", body);