public void ComplexXmlDocument() { XmlBuilder xmlBuilder = new XmlBuilder(); xmlBuilder.AppendXmlDeclaration(null, null); xmlBuilder.AddAttribute("version", "2.01"); xmlBuilder.AppendStartTag("rss"); xmlBuilder.AppendStartTag("channel"); xmlBuilder.AppendElement("name", "Rss 2.01 Channel"); xmlBuilder.AppendEndTag(); xmlBuilder.AppendEndTag(); Assert.AreEqual("<?xml version=\"1.0\" encoding=\"utf-8\"?><rss version=\"2.01\"><channel><name>Rss 2.01 Channel</name></channel></rss>", xmlBuilder.ToString()); }
public void AppendEndTag2() { XmlBuilder xmlBuilder = new XmlBuilder(); xmlBuilder.AppendStartTag("ns", "tag"); xmlBuilder.AppendEndTag(); Assert.AreEqual("<ns:tag></ns:tag>", xmlBuilder.ToString()); }
public void AppendEndTagWithoutStartTag() { XmlBuilder xmlBuilder = new XmlBuilder(); xmlBuilder.AppendEndTag(); }