public void PrintEscapeCharPrintsEscapedCharAsLiteral() { // Arrange HtmlObjectPrinter printer = new HtmlObjectPrinter(100, 100); HtmlElement element = new HtmlElement("span"); printer.PushElement(element); // Act printer.VisitConvertedValue('\t', "\t"); // Assert Assert.Equal(1, element.Children.Count); HtmlElement child = element.Children[0]; Assert.Equal("'\\t'", child.InnerText); Assert.Equal("quote", child["class"]); }
public void PrintCharPrintsQuotedString() { // Arrange HtmlObjectPrinter printer = new HtmlObjectPrinter(100, 100); HtmlElement element = new HtmlElement("span"); printer.PushElement(element); // Act printer.VisitConvertedValue('x', "x"); // Assert Assert.Equal(1, element.Children.Count); HtmlElement child = element.Children[0]; Assert.Equal("'x'", child.InnerText); Assert.Equal("quote", child["class"]); }