public void Write_NamedItems()
        {
            // foo
            // - bar
            // -- foo
            // - baz
            var obj  = new NamedItem("foo");
            var obj2 = new NamedItem("bar");

            obj.References.Add(obj2);
            obj.References.Add(new NamedItem("baz"));
            obj2.References.Add(obj);

            Assert.AreEqual(ReadXml("NamedItems.xml").Trim(), XamlServices.Save(obj), "#1");
        }
Example #2
0
        public void Read_NamedItemWithEmptyString()
        {
            var obj = new NamedItem("");
            var ctx = new XamlSchemaContext();
            var xr  = new XamlObjectReader(obj, ctx);

            ReadNamespace(xr, "", Compat.TestAssemblyNamespace, "ns1");

            ReadObject(xr, ctx.GetXamlType(typeof(NamedItem)), "#1", xt =>
            {
                ReadMember(xr, xt.GetMember("ItemName"), "#2", xm =>
                {
                    ReadValue(xr, string.Empty, "#3");
                });
            });
        }
Example #3
0
        public void Read_NamedItems()
        {
            // foo
            // - bar
            // -- foo
            // - baz
            var obj  = new NamedItem("foo");
            var obj2 = new NamedItem("bar");

            obj.References.Add(obj2);
            obj.References.Add(new NamedItem("baz"));
            obj2.References.Add(obj);

            var xr = new XamlObjectReader(obj);

            Read_NamedItems(xr, true);
        }
Example #4
0
        public void Write_NamedItemWithEmptyString()
        {
            var obj = new NamedItem("");

            Assert.AreEqual(ReadXml("NamedItemWithEmptyString.xml").Trim(), XamlServices.Save(obj), "#1");
        }