Esempio n. 1
0
 public void CanRoundTripAnObjectOfASubclassType()
 {
     var serializer = new XmlSerializer<Thingy>(x => x.Indent());
     var thingy = new ThingyDerived { Value = "abc", AnotherValue = "xyz" };
     var xml = serializer.Serialize(thingy);
     var roundTrip = serializer.Deserialize(xml);
     Assert.That(roundTrip.Value, Is.EqualTo(thingy.Value));
 }
Esempio n. 2
0
        public void CanSerializeAnObjectOfASubclassType()
        {
            var serializer = new XmlSerializer <Thingy>(x => x.Indent());
            var thingy     = new ThingyDerived {
                Value = "abc", AnotherValue = "xyz"
            };

            Assert.That(() => serializer.Serialize(thingy), Throws.Nothing);
        }
Esempio n. 3
0
        public void CanRoundTripAnObjectOfASubclassType()
        {
            var serializer = new XmlSerializer <Thingy>(x => x.Indent());
            var thingy     = new ThingyDerived {
                Value = "abc", AnotherValue = "xyz"
            };
            var xml       = serializer.Serialize(thingy);
            var roundTrip = serializer.Deserialize(xml);

            Assert.That(roundTrip.Value, Is.EqualTo(thingy.Value));
        }
Esempio n. 4
0
 public void CanSerializeAnObjectOfASubclassType()
 {
     var serializer = new XmlSerializer<Thingy>(x => x.Indent());
     var thingy = new ThingyDerived { Value = "abc", AnotherValue = "xyz" };
     Assert.That(() => serializer.Serialize(thingy), Throws.Nothing);
 }