This commit is contained in:
N. Taylor Mullen 2016-03-28 16:59:48 -07:00
parent 529fa67c2b
commit b7c90c4a67
3 changed files with 12 additions and 12 deletions

View File

@ -52,7 +52,7 @@ __Microsoft_AspNetCore_Mvc_Razor_InputTestTagHelper.For = CreateModelExpression(
#line default #line default
#line hidden #line hidden
__tagHelperExecutionContext.AddTagHelperAttribute("for", __Microsoft_AspNetCore_Mvc_Razor_InputTestTagHelper.For); __tagHelperExecutionContext.AddTagHelperAttribute("for", __Microsoft_AspNetCore_Mvc_Razor_InputTestTagHelper.For);
__tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
BeginContext(128, 24, false); BeginContext(128, 24, false);
Write(__tagHelperExecutionContext.Output); Write(__tagHelperExecutionContext.Output);
EndContext(); EndContext();
@ -71,7 +71,7 @@ __Microsoft_AspNetCore_Mvc_Razor_InputTestTagHelper.For = CreateModelExpression(
#line default #line default
#line hidden #line hidden
__tagHelperExecutionContext.AddTagHelperAttribute("for", __Microsoft_AspNetCore_Mvc_Razor_InputTestTagHelper.For); __tagHelperExecutionContext.AddTagHelperAttribute("for", __Microsoft_AspNetCore_Mvc_Razor_InputTestTagHelper.For);
__tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
BeginContext(154, 27, false); BeginContext(154, 27, false);
Write(__tagHelperExecutionContext.Output); Write(__tagHelperExecutionContext.Output);
EndContext(); EndContext();

View File

@ -1198,14 +1198,14 @@ namespace Microsoft.AspNetCore.Mvc.Razor
page.EndAddHtmlAttributeValues(executionContext); page.EndAddHtmlAttributeValues(executionContext);
// Assert // Assert
var output = executionContext.CreateTagHelperOutput(); var output = executionContext.Output;
var htmlAttribute = Assert.Single(output.Attributes); var htmlAttribute = Assert.Single(output.Attributes);
Assert.Equal("someattr", htmlAttribute.Name, StringComparer.Ordinal); Assert.Equal("someattr", htmlAttribute.Name, StringComparer.Ordinal);
var htmlContent = Assert.IsAssignableFrom<IHtmlContent>(htmlAttribute.Value); var htmlContent = Assert.IsAssignableFrom<IHtmlContent>(htmlAttribute.Value);
Assert.Equal(expectedValue, HtmlContentUtilities.HtmlContentToString(htmlContent), StringComparer.Ordinal); Assert.Equal(expectedValue, HtmlContentUtilities.HtmlContentToString(htmlContent), StringComparer.Ordinal);
Assert.False(htmlAttribute.Minimized); Assert.False(htmlAttribute.Minimized);
var context = executionContext.CreateTagHelperContext(); var context = executionContext.Context;
var allAttribute = Assert.Single(context.AllAttributes); var allAttribute = Assert.Single(context.AllAttributes);
Assert.Equal("someattr", allAttribute.Name, StringComparer.Ordinal); Assert.Equal("someattr", allAttribute.Name, StringComparer.Ordinal);
htmlContent = Assert.IsAssignableFrom<IHtmlContent>(allAttribute.Value); htmlContent = Assert.IsAssignableFrom<IHtmlContent>(allAttribute.Value);
@ -1238,9 +1238,9 @@ namespace Microsoft.AspNetCore.Mvc.Razor
page.EndAddHtmlAttributeValues(executionContext); page.EndAddHtmlAttributeValues(executionContext);
// Assert // Assert
var output = executionContext.CreateTagHelperOutput(); var output = executionContext.Output;
Assert.Empty(output.Attributes); Assert.Empty(output.Attributes);
var context = executionContext.CreateTagHelperContext(); var context = executionContext.Context;
var attribute = Assert.Single(context.AllAttributes); var attribute = Assert.Single(context.AllAttributes);
Assert.Equal("someattr", attribute.Name, StringComparer.Ordinal); Assert.Equal("someattr", attribute.Name, StringComparer.Ordinal);
Assert.Equal(expectedValue, (string)attribute.Value, StringComparer.Ordinal); Assert.Equal(expectedValue, (string)attribute.Value, StringComparer.Ordinal);
@ -1268,12 +1268,12 @@ namespace Microsoft.AspNetCore.Mvc.Razor
page.EndAddHtmlAttributeValues(executionContext); page.EndAddHtmlAttributeValues(executionContext);
// Assert // Assert
var output = executionContext.CreateTagHelperOutput(); var output = executionContext.Output;
var htmlAttribute = Assert.Single(output.Attributes); var htmlAttribute = Assert.Single(output.Attributes);
Assert.Equal("someattr", htmlAttribute.Name, StringComparer.Ordinal); Assert.Equal("someattr", htmlAttribute.Name, StringComparer.Ordinal);
Assert.Equal("someattr", (string)htmlAttribute.Value, StringComparer.Ordinal); Assert.Equal("someattr", (string)htmlAttribute.Value, StringComparer.Ordinal);
Assert.False(htmlAttribute.Minimized); Assert.False(htmlAttribute.Minimized);
var context = executionContext.CreateTagHelperContext(); var context = executionContext.Context;
var allAttribute = Assert.Single(context.AllAttributes); var allAttribute = Assert.Single(context.AllAttributes);
Assert.Equal("someattr", allAttribute.Name, StringComparer.Ordinal); Assert.Equal("someattr", allAttribute.Name, StringComparer.Ordinal);
Assert.Equal("someattr", (string)allAttribute.Value, StringComparer.Ordinal); Assert.Equal("someattr", (string)allAttribute.Value, StringComparer.Ordinal);

View File

@ -114,10 +114,10 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
}); });
// Act // Act
var output = await runner.RunAsync(tagHelperExecutionContext); await runner.RunAsync(tagHelperExecutionContext);
// Assert // Assert
Assert.Equal(expectedOutput, output.PostContent.GetContent()); Assert.Equal(expectedOutput, tagHelperExecutionContext.Output.PostContent.GetContent());
} }
private static TagBuilder GetTagBuilder(string tag, string name, string type, string value, TagRenderMode mode) private static TagBuilder GetTagBuilder(string tag, string name, string type, string value, TagRenderMode mode)