Fix UrlResolutionTagHelper tag helper inclusion.

- Also fixed test name to assert all defaultly included TagHelpers instead of just the UrlResolutionTagHelper
This commit is contained in:
N. Taylor Mullen 2017-03-29 16:29:57 -07:00
parent 60a87829f8
commit fdea42624d
2 changed files with 3 additions and 3 deletions

View File

@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
writer.WriteLine("@inject global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component");
writer.WriteLine("@inject global::Microsoft.AspNetCore.Mvc.IUrlHelper Url");
writer.WriteLine("@inject global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider");
writer.WriteLine("@addTagHelper Microsoft.AspNetCore.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor");
writer.WriteLine("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor");
writer.WriteLine("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor");
writer.WriteLine("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor");
writer.Flush();

View File

@ -67,7 +67,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
}
[Fact]
public void GetDefaultImports_IncludesUrlTagHelper()
public void GetDefaultImports_IncludesDefaultTagHelpers()
{
// Arrange
var mvcRazorTemplateEngine = new MvcRazorTemplateEngine(
@ -81,7 +81,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
var importContent = GetContent(imports)
.Split(new[] { Environment.NewLine }, StringSplitOptions.None)
.Where(line => line.StartsWith("@addTagHelper"));
Assert.Contains("@addTagHelper Microsoft.AspNetCore.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor", importContent);
Assert.Contains("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor", importContent);
Assert.Contains("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor", importContent);
Assert.Contains("@addTagHelper Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor", importContent);
}