Exemple #1
0
        public void Xml_CanSerializeInOneNamespaceAndDeserializeInAnother()
        {
            XmlStandardSerializer.SerializeObjectGraph(_infoSaved, "SaveInOneNamespaceLoadInAnother.xml");

            var loadInfo =
                (PokerTell.Infrastructure.Tests.Serialization.OtherNameSpace.InfoToSaveClass)
                XmlStandardSerializer.DeserializeObjectGraph(
                    "SaveInOneNamespaceLoadInAnother.xml",
                    typeof(PokerTell.Infrastructure.Tests.Serialization.OtherNameSpace.InfoToSaveClass));

            Assert.That(loadInfo.ToString(), Is.EqualTo(_infoSaved.ToString()));
        }
Exemple #2
0
 public void Xml_SerializingFromNonExistingFileThrowsFileNotFoundException()
 {
     Assert.Throws <FileNotFoundException>(
         () => XmlStandardSerializer.DeserializeObjectGraph("DoesntExist.xml", typeof(InfoToSaveClass)));
 }