public void ToString () { var el = new XStreamingElement ("foo", new XAttribute ("bar", "baz"), "text"); Assert.AreEqual ("<foo bar=\"baz\">text</foo>", el.ToString ()); }
public void ToStringAttributeAfterText () { var el = new XStreamingElement ("foo", "text", new XAttribute ("bar", "baz")); el.ToString (); }
public void XNameConstructor() { XStreamingElement streamElement = new XStreamingElement("contact"); Assert.Equal("<contact />", streamElement.ToString()); }
public void XNameAndNullObjectConstructor() { XStreamingElement streamElement = new XStreamingElement("contact", null); Assert.Equal("<contact />", streamElement.ToString()); }
public void AddWithNull() { XStreamingElement streamElement = new XStreamingElement("contact"); streamElement.Add(null); Assert.Equal("<contact />", streamElement.ToString()); }
public void XMLPropertyGet() { XElement contact = new XElement("contact", new XElement("phone", "925-555-0134")); XStreamingElement streamElement = new XStreamingElement("contact", contact.Element("phone")); Assert.Equal(contact.ToString(SaveOptions.None), streamElement.ToString(SaveOptions.None)); }
//[Variation(Priority = 0, Desc = "Constructor - XStreamingElement(XName)")] public void XNameConstructor() { XStreamingElement streamElement = new XStreamingElement("contact"); if (!streamElement.ToString().Equals("<contact />")) throw new TestFailedException(""); }
//[Variation(Priority = 1, Desc = "Add(null)")] public void AddWithNull() { XStreamingElement streamElement = new XStreamingElement("contact"); streamElement.Add(null); if (!streamElement.ToString().Equals("<contact />")) throw new TestFailedException(""); }
//[Variation(Priority = 0, Desc = "XML Property")] public void XMLPropertyGet() { XElement contact = new XElement("contact", new XElement("phone", "925-555-0134")); XStreamingElement streamElement = new XStreamingElement("contact", contact.Element("phone")); if (!streamElement.ToString(SaveOptions.None).Equals(contact.ToString(SaveOptions.None))) throw new TestFailedException(""); }