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"); }
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"); }); }); }
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); }
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); }
public void Write_NamedItemWithEmptyString() { var obj = new NamedItem(""); Assert.AreEqual(ReadXml("NamedItemWithEmptyString.xml").Trim(), XamlServices.Save(obj), "#1"); }