public void HasAttribute() { var tag = new Tag("div") { {"id", "foo"} }; Assert.AreEqual("foo", tag["id"]); Assert.IsNull(tag[0]); Assert.AreEqual("<div id=\"foo\"></div>", tag.ToString()); }
public void HasChild() { var tag = new Tag("div") { new Tag("p") { "Hello World" } }; Assert.IsInstanceOfType<Tag>(tag[0]); Assert.AreEqual("<div><p>Hello World</p></div>", tag.ToString()); }
public void HasAttributeAndChild() { var tag = new Tag("div") { {"id", "foo"}, new Tag("p") { "Hello World" } }; Assert.AreEqual("foo", tag["id"]); Assert.AreEqual("<div id=\"foo\"><p>Hello World</p></div>", tag.ToString()); }
public void IsEmpty() { var tag = new Tag("div"); Assert.IsNull(tag[0]); Assert.AreEqual("<div></div>", tag.ToString()); }
public void HasText() { var tag = new Tag("p") { "Hello World" }; Assert.IsInstanceOfType<Tag>(tag[0]); Assert.AreEqual("<p>Hello World</p>", tag.ToString()); }