public void TestDeserializeSimulationException() { SimulationException exception = new SimulationException("Custom message", "Name of the simulation", "The filename"); using (Stream stream = ReflectionUtilities.BinarySerialise(exception)) { stream.Seek(0, SeekOrigin.Begin); SimulationException cloned = (SimulationException)ReflectionUtilities.BinaryDeserialise(stream); Assert.AreEqual(exception.Message, cloned.Message); Assert.AreEqual(exception.SimulationName, cloned.SimulationName); Assert.AreEqual(exception.FileName, cloned.FileName); } }