コード例 #1
0
        public void TestMixedContent()
        {
            var elem = new Stream();

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

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

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

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