public void TestToString() { var e = HtmlDoc.Parse(test2); Assert.AreEqual(test2Formated, e.ToString()); Assert.AreEqual(test2, e.ToString(false)); }
public void TestDescendants() { var e = HtmlDoc.Parse(test1); Assert.IsTrue(e.Descendants().Count() > 1); Assert.AreEqual(6, e.Element("ul").Descendants("li").Count()); }
public void TestAttributes() { var e = HtmlDoc.Parse(test3); Assert.AreEqual("Content-Type", e.Attributes["http-equiv"]); Assert.AreEqual("text/html; charset=utf-8", e.Attributes["content"]); }
public void TestMismatch() { var e = HtmlDoc.Parse(test4); Assert.AreEqual(6, e.Descendants().Count()); e = HtmlDoc.Parse(test44).Element().Element(); Assert.AreEqual("ul", e.Name); //Assert.AreEqual<int>(3, e.Descendants().Count()); ///TODO: look up html tags //Assert.AreEqual<string>("ul", e.Descendants().Last().Name); }
public void TestSelfClosed() { var e = HtmlDoc.Parse(test3); Assert.AreEqual("meta", e.Name); }
public void TestLink() { var e = HtmlDoc.Parse("<a href='./' target='_blank'>STAGE1</a>"); Assert.AreEqual("STAGE1", e.InnerHtml); }