public void WriteTo_WritesFormattedTagHelper(TagHelperOutput output, string expected) { // Arrange var writer = new StringWriter(); var testEncoder = new HtmlTestEncoder(); // Act output.WriteTo(writer, testEncoder); // Assert Assert.Equal(expected, writer.ToString(), StringComparer.Ordinal); }
public void WriteTo_WritesFormattedTagHelper(TagHelperOutput output, string expected) { // Arrange var writer = new StringWriter(); var tagHelperExecutionContext = new TagHelperExecutionContext( tagName: output.TagName, tagMode: output.TagMode, items: new Dictionary <object, object>(), uniqueId: string.Empty, executeChildContentAsync: () => Task.FromResult(result: true), startTagHelperWritingScope: _ => { }, endTagHelperWritingScope: () => new DefaultTagHelperContent()); tagHelperExecutionContext.Output = output; var testEncoder = new HtmlTestEncoder(); // Act output.WriteTo(writer, testEncoder); // Assert Assert.Equal(expected, writer.ToString(), StringComparer.Ordinal); }
public void WriteTo_WritesFormattedTagHelper(TagHelperOutput output, string expected) { // Arrange var writer = new StringWriter(); var tagHelperExecutionContext = new TagHelperExecutionContext( tagName: output.TagName, tagMode: output.TagMode, items: new Dictionary<object, object>(), uniqueId: string.Empty, executeChildContentAsync: () => Task.FromResult(result: true), startTagHelperWritingScope: _ => { }, endTagHelperWritingScope: () => new DefaultTagHelperContent()); tagHelperExecutionContext.Output = output; var testEncoder = new HtmlTestEncoder(); // Act output.WriteTo(writer, testEncoder); // Assert Assert.Equal(expected, writer.ToString(), StringComparer.Ordinal); }