public void TestSerialization() { SpObject obj = CreateInstance(); List<SpObject> objs = new List<SpObject>() { obj }; using (Stream stream = File.Open("SpaceObjectXml.txt", FileMode.Create)) { var xmlformatter = new SpaceSerializer<List<SpObject>>(); xmlformatter.Serialize(stream, objs); } List<SpObject> objs2; using (Stream stream = File.Open("SpaceObjectXml.txt", FileMode.Open)) { var xmlformatter = new SpaceSerializer<List<SpObject>>(); objs2 = xmlformatter.Deserialize(stream); } SpObject obj2 = objs2.First(); Assert.IsNotNull(obj2); Assert.IsTrue(obj2.Equals(obj)); }