Skip to content

Commit

Permalink
PR comments: Restore most of `PrecompilationTest.PrecompiledView_Rend…
Browse files Browse the repository at this point in the history
…ersCorrectly()`
  • Loading branch information
dougbu committed Oct 28, 2015
1 parent c8c0c53 commit dc32f8a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
22 changes: 22 additions & 0 deletions test/Microsoft.AspNet.Mvc.FunctionalTests/PrecompilationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection;
using System.Threading.Tasks;
Expand All @@ -22,6 +23,27 @@ public PrecompilationTest(MvcTestFixture<PrecompilationWebSite.Startup> fixture)

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()
{
Expand Down

0 comments on commit dc32f8a

Please sign in to comment.