Exemple #1
0
 public void CheckSaveAndLoadWithBinaryDataFactory()
 {
     var info = new Info(TestInfoText);
     using (var dataFactory = new BinaryDataFactory())
     using (var dataStream = new MemoryStream())
     {
         dataFactory.Save(info, new BinaryWriter(dataStream));
         dataStream.Position = 0;
         var loadedInfo = (Info)dataFactory.Load(new BinaryReader(dataStream));
         Assert.AreEqual(info, loadedInfo);
     }
 }
Exemple #2
0
 public void CheckSaveAndLoadWithBinaryDataFactory()
 {
     var error = new Error(TestException);
     using (var dataFactory = new BinaryDataFactory())
     using (var dataStream = new MemoryStream())
     {
         dataFactory.Save(error, new BinaryWriter(dataStream));
         dataStream.Position = 0;
         var loadedError = (Error)dataFactory.Load(new BinaryReader(dataStream));
         Assert.AreEqual(error, loadedError);
     }
 }
 public void CheckSaveAndLoadWithBinaryDataFactory()
 {
     var warning = new Warning(TestWarningText);
     using (var dataFactory = new BinaryDataFactory())
     using (var dataStream = new MemoryStream())
     {
         dataFactory.Save(warning, new BinaryWriter(dataStream));
         dataStream.Position = 0;
         var loadedWarning = (Warning)dataFactory.Load(new BinaryReader(dataStream));
         Assert.AreEqual(warning, loadedWarning);
     }
 }