asdf
fdsajkl;";
String expectedResult = "
asdffdsajkl;
";
HtmlNode htmlNode = Parser.Parse(htmlText);
Assert.IsNotNull(htmlNode, "The HtmlNode returned by the parser is null.");
Assert.IsInstanceOfType(htmlNode.Children[0], typeof(HtmlDivNode));
Assert.AreEqual
(expectedResult, htmlNode.InnerHtml);
}
[TestMethod]
public void Test_Parse_UnescapedAmpersand()
{
String htmlText = "hello&world";
String expectedResult = "hello&world";
HtmlNode htmlNode = Parser.Parse(htmlText);
Assert.IsNotNull(htmlNode);
Assert.AreEqual(expectedResult, htmlNode.InnerHtml);
}
[TestMethod]
public void Test_Parse_UnescapedLessThan()
{
String htmlText = "hello(expectedResult, htmlNode.InnerHtml);
}
[TestMethod]
public void Test_Parse_UnescapedLessThanThatLooksLikeATag()
{
String htmlText = "hello(expectedResult, htmlNode.InnerHtml);
}
[TestMethod]
public void Test_Parse_UnescapedGreaterThan()
{
String htmlText = "hello>world";
String expectedResult = "hello>world";
HtmlNode htmlNode = Parser.Parse(htmlText);
Assert.IsNotNull(htmlNode);
Assert.AreEqual
(expectedResult, htmlNode.InnerHtml);
}
[TestMethod]
public void Test_Parse_UnescapedQuote()
{
String htmlText = "hello\"world";
String expectedResult = "hello"world";
HtmlNode htmlNode = Parser.Parse(htmlText);
Assert.IsNotNull(htmlNode);
Assert.IsInstanceOfType(htmlNode.Children[0], typeof(HtmlTextNode));
Assert.AreEqual(expectedResult, htmlNode.InnerHtml);
}
[TestMethod]
public void Test_Parse_UnopenedTag()
{
String htmlText = "hello world
";
String expectedResult = "hello world
";
HtmlNode htmlNode = Parser.Parse(htmlText);
Assert.IsNotNull(htmlNode);
Assert.IsInstanceOfType(htmlNode.Children[0], typeof(HtmlDivNode));
Assert.AreEqual(expectedResult, htmlNode.InnerHtml);
}
}
}