public void TestListPersistance() { Listy l = new Listy(); l.animals = new List <Animal>(); l.animals.Add(new Dog()); l.animals.Add(new Animal()); var copy = Serializer.Clone(l); Assert.AreEqual(2, copy.animals.Count()); Assert.AreEqual(copy.animals[0].GetType(), typeof(Dog)); }
public void TestListPersistance() { Listy l = new Listy { animals = new List <Animal> { new Dog(), new Animal() } }; var copy = Serializer.DeepClone(l); Assert.Equal(2, copy.animals.Count()); Assert.Equal(copy.animals[0].GetType(), typeof(Dog)); }
public void TestListPersistance() { Listy l = new Listy(); l.animals = new List<Animal>(); l.animals.Add(new Dog()); l.animals.Add(new Animal()); var copy = Serializer.Clone(l); Assert.AreEqual(2, copy.animals.Count()); Assert.AreEqual(copy.animals[0].GetType(), typeof(Dog)); }