public void TestGetDocumentValue() { // Arrange const string contents = @"<html> <body> <span>test</span> </body> </html>"; var doc = new HtmlParser(contents); // Act var result = doc.GetDocumentValue("//span", null); // Arrange Assert.AreEqual(result, "test"); }
public void TestGetDocumentValueWithAttribute() { // Arrange const string contents = @"<html> <body> <span class='col'>test</span> </body> </html>"; var doc = new HtmlParser(contents); // Act var result = doc.GetDocumentValue("//span", "class"); // Arrange Assert.AreEqual(result, "col"); }