예제 #1
0
        public void CollectionItem()
        {
            GenericScriptComponent c   = new GenericScriptComponent("generic");
            StringWriter           sw  = new StringWriter();
            ScriptTextWriter       w   = new ScriptTextWriter(sw);
            GenericScriptComponent foo = new GenericScriptComponent("foo");

            c.AddCollectionItem("behaviors", foo);

            ((IScriptComponent)c).RenderScript(w);

            Assert.AreEqual("<generic>\n  <behaviors>\n    <foo />\n  </behaviors>\n</generic>", sw.ToString().Replace("\r\n", "\n"), "A1");
        }
예제 #2
0
        public void ValueProperty_duplicate()
        {
            GenericScriptComponent c  = new GenericScriptComponent("generic");
            StringWriter           sw = new StringWriter();
            ScriptTextWriter       w  = new ScriptTextWriter(sw);

            c.AddValueProperty("key1", "value1");
            c.AddValueProperty("key1", "value2");

            ((IScriptComponent)c).RenderScript(w);

            Assert.AreEqual("<generic key1=\"value2\" />", sw.ToString(), "A1");
        }