public void ShouldReadSimpleXmlWithNestedElement() { byte[] a = System.Text.Encoding.GetEncoding("iso-8859-1").GetBytes("<mockElement><test /></mockElement>"); MemoryStream stream = new MemoryStream(a); MockElement o = (MockElement) new Persister().Read(typeof(MockElement), stream); NUnit.Framework.Assert.IsNotNull(o, "object"); NUnit.Framework.Assert.IsNotNull(o.Test, "myTest"); }
public void ShouldReadSimpleXml() { byte[] a = System.Text.Encoding.GetEncoding("iso-8859-1").GetBytes("<mockElement name=\"fred\"></mockElement>"); MemoryStream stream = new MemoryStream(a); MockElement o = (MockElement) new Persister().Read(typeof(MockElement), stream); NUnit.Framework.Assert.IsNotNull(o, "object"); NUnit.Framework.Assert.AreEqual(o.Name, "fred", "name"); }