public void TestMoveToId() { using (GumboWrapper gumbo = new GumboWrapper(TestHtml)) { var nav = gumbo.CreateNavigator(); nav.MoveToId("tag123"); Assert.AreEqual("p", nav.Name); } }
public void TestSelectSingleNodeForElement() { using (GumboWrapper gumbo = new GumboWrapper(TestHtml)) { var nav = gumbo.CreateNavigator(); var node = nav.SelectSingleNode("/html/body/span"); Assert.AreEqual("Pillz here!", node.Value); Assert.AreEqual("span", node.Name); Assert.AreEqual("span", node.LocalName); } }
public void TestSelectSingleNodeAttribute() { using (GumboWrapper gumbo = new GumboWrapper(TestHtml)) { var nav = gumbo.CreateNavigator(); var node = nav.SelectSingleNode("/html/body/@class"); Assert.AreEqual("gumbo", node.Value); Assert.AreEqual("class", node.Name); Assert.AreEqual("class", node.LocalName); } }