Exemplo n.º 1
0
		public void ToString ()
		{
			var el = new XStreamingElement ("foo",
				new XAttribute ("bar", "baz"),
				"text");
			Assert.AreEqual ("<foo bar=\"baz\">text</foo>", el.ToString ());
		}
Exemplo n.º 2
0
		public void ToStringAttributeAfterText ()
		{
			var el = new XStreamingElement ("foo",
				"text",
				new XAttribute ("bar", "baz"));
			el.ToString ();
		}
Exemplo n.º 3
0
 public void XNameConstructor()
 {
     XStreamingElement streamElement = new XStreamingElement("contact");
     Assert.Equal("<contact />", streamElement.ToString());
 }
Exemplo n.º 4
0
 public void XNameAndNullObjectConstructor()
 {
     XStreamingElement streamElement = new XStreamingElement("contact", null);
     Assert.Equal("<contact />", streamElement.ToString());
 }
Exemplo n.º 5
0
 public void AddWithNull()
 {
     XStreamingElement streamElement = new XStreamingElement("contact");
     streamElement.Add(null);
     Assert.Equal("<contact />", streamElement.ToString());
 }
Exemplo n.º 6
0
 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));
 }
Exemplo n.º 7
0
 //[Variation(Priority = 0, Desc = "Constructor - XStreamingElement(XName)")]
 public void XNameConstructor()
 {
     XStreamingElement streamElement = new XStreamingElement("contact");
     if (!streamElement.ToString().Equals("<contact />"))
         throw new TestFailedException("");
 }
Exemplo n.º 8
0
 //[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("");
 }
Exemplo n.º 9
0
 //[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("");
 }