PR comments: Restore most of `PrecompilationTest.PrecompiledView_RendersCorrectly()`

This commit is contained in:
Doug Bunting 2015-10-27 16:27:44 -07:00
parent c8c0c5303e
commit dc32f8ae33
2 changed files with 22 additions and 1 deletions

View File

@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;

View File

@ -3,6 +3,7 @@
using System;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection;
using System.Threading.Tasks;
@ -22,6 +23,27 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
public HttpClient Client { get; }
[ConditionalFact]
[FrameworkSkipCondition(RuntimeFrameworks.Mono)]
public async Task PrecompiledView_RendersCorrectly()
{
// Arrange
// We will render a view that writes the fully qualified name of the Assembly containing the type of
// the view. If the view is precompiled, this assembly will be PrecompilationWebsite.
var assemblyNamePrefix = GetAssemblyNamePrefix();
// Act
var response = await Client.GetAsync("http://localhost/Home/Index");
var responseContent = await response.Content.ReadAsStringAsync();
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
var parsedResponse1 = new ParsedResponse(responseContent);
Assert.StartsWith(assemblyNamePrefix, parsedResponse1.ViewStart);
Assert.StartsWith(assemblyNamePrefix, parsedResponse1.Layout);
Assert.StartsWith(assemblyNamePrefix, parsedResponse1.Index);
}
[Fact]
public async Task PrecompiledView_UsesCompilationOptionsFromApplication()
{