public void AppendElementEmptyText() { XmlBuilder xmlBuilder = new XmlBuilder(); xmlBuilder.AppendElement("tag", string.Empty); Assert.AreEqual("<tag></tag>", xmlBuilder.ToString()); }
public void AppendElementNullText() { XmlBuilder xmlBuilder = new XmlBuilder(); xmlBuilder.AppendElement("tag", null); Assert.AreEqual("<tag />", xmlBuilder.ToString()); }
public void AppendElement() { XmlBuilder xmlBuilder = new XmlBuilder(); xmlBuilder.AppendElement("tag", "inner text"); Assert.AreEqual("<tag>inner text</tag>", xmlBuilder.ToString()); }
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 AppendElementEmptyName() { XmlBuilder xmlBuilder = new XmlBuilder(); xmlBuilder.AppendElement(string.Empty, string.Empty); }
public void AppendElementNullName() { XmlBuilder xmlBuilder = new XmlBuilder(); xmlBuilder.AppendElement(null, string.Empty); }