示例#1
0
        public void TestMixedContent()
        {
            var elem = new Sip();

            elem.AddText("before")
            .AddChild("Child").AddText("content");
            elem.AddText("after");

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
                "<Sip>before<Child>content</Child>after</Sip>",
                elem.ToString()
                );
        }
示例#2
0
        public void TestElementWithTextNode()
        {
            var elem = new Sip();

            elem.AddText("Here is the content");

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
                "<Sip>Here is the content</Sip>",
                elem.ToString()
                );
        }