Adding functional test to verify error page middleware includes raw compilation content.

This commit is contained in:
Pranav K 2016-10-26 12:30:39 -07:00
parent 8f6a0fc4fa
commit dd29d562b8
1 changed files with 3 additions and 0 deletions

View File

@ -74,6 +74,8 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
// Arrange
var expectedMessage = "The type or namespace name 'NamespaceDoesNotExist' could not be found ("
+ "are you missing a using directive or an assembly reference?)";
var expectedCompilationContent = "public class _Views_ErrorFromViewImports_Index_cshtml : "
+ "Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>";
var expectedMediaType = MediaTypeHeaderValue.Parse("text/html; charset=utf-8");
// Act
@ -86,6 +88,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
Assert.Contains("/Views/ErrorFromViewImports/_ViewImports.cshtml", content);
Assert.Contains(expectedMessage, content);
Assert.Contains(PreserveCompilationContextMessage, content);
Assert.Contains(expectedCompilationContent, content);
}
[Fact]