Beispiel #1
0
        public static void Deserializable <T>(T obj) where T : class
        {
            string expected = null;

            AssertEx.RoundTrip(obj, ref expected);
            var xmlElementHelper = new XmlElementHelper <T>();

            using (var xmlReader = XmlReader.Create(new StringReader(expected)))
            {
                while (!xmlReader.IsStartElement())
                {
                    xmlReader.Read();
                }
                var obj2 = xmlElementHelper.Deserialize(xmlReader);
                Assert.AreEqual(obj, obj2);
            }
        }