public void SuppressOutput_PreventsTagOutput() { // Arrange var tagHelperOutput = new TagHelperOutput("p", attributes: new Dictionary<string, string> { { "class", "btn" }, { "something", " spaced " } }) { PreContent = "Pre Content", Content = "Content", PostContent = "Post Content" }; // Act tagHelperOutput.SuppressOutput(); // Assert Assert.Empty(tagHelperOutput.GenerateStartTag()); Assert.Null(tagHelperOutput.GeneratePreContent()); Assert.Null(tagHelperOutput.GenerateContent()); Assert.Null(tagHelperOutput.GeneratePostContent()); Assert.Empty(tagHelperOutput.GenerateEndTag()); }
public void GeneratePostContent_ReturnsPostContent() { // Arrange var tagHelperOutput = new TagHelperOutput("p") { PostContent = "Hello World" }; // Act var output = tagHelperOutput.GeneratePostContent(); // Assert Assert.Equal("Hello World", output); }
public void GeneratePostContent_ReturnsNothingIfSelfClosing() { // Arrange var tagHelperOutput = new TagHelperOutput("p") { SelfClosing = true, PostContent = "Hello World" }; // Act var output = tagHelperOutput.GeneratePostContent(); // Assert Assert.Empty(output); }