public void Attribute_WithMatch_ReturnsAttributeValue() { var nodes = GetNodes("<a href='someurl'>text</a>"); var elements = new Elements(nodes); Assert.That(elements.Attribute("href"), Is.EqualTo("someurl")); }
public void Attribute_MultipleNodes_ReturnsFirstFoundAttributeValue() { var nodes = GetNodes("<a href='url'>text</a><a href='otherurl'>text</a>"); var elements = new Elements(nodes); Assert.That(elements.Attribute("href"), Is.EqualTo("url")); }
public void Attribute_WithoutElements_ReturnStringEmpty() { var elements = new Elements(null); Assert.That(elements.Attribute("href"), Is.EqualTo(string.Empty)); }