Ejemplo n.º 1
0
        public void TestElementWithParams()
        {
            var elem = new SsmlS("words");

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
                "<s>words</s>",
                elem.ToString()
                );
        }
Ejemplo n.º 2
0
        public void TestEmptyElement()
        {
            var elem = new SsmlS();

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
                "<s></s>",
                elem.ToString()
                );
        }
Ejemplo n.º 3
0
        public void TestElementWithTextNode()
        {
            var elem = new SsmlS();

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

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
                "<s>Here is the content</s>",
                elem.ToString()
                );
        }
Ejemplo n.º 4
0
        public void TestElementWithExtraAttributes()
        {
            var elem = new SsmlS();

            elem.SetOption("newParam1", "value");
            elem.SetOption("newParam2", 1);

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
                "<s newParam1=\"value\" newParam2=\"1\"></s>",
                elem.ToString()
                );
        }
Ejemplo n.º 5
0
        public void TestMixedContent()
        {
            var elem = new SsmlS();

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

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
                "<s>before<Child>content</Child>after</s>",
                elem.ToString()
                );
        }
Ejemplo n.º 6
0
        public void TestAllowGenericChildNodes()
        {
            var elem = new SsmlS();

            elem.AddChild("generic-tag").AddText("Content").SetOption("tag", true);

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
                "<s>" + Environment.NewLine +
                "  <generic-tag tag=\"True\">Content</generic-tag>" + Environment.NewLine +
                "</s>",
                elem.ToString()
                );
        }