public void JSONSerialiser_Serialisation_DoesntThrowOnValidData() { IBaseMessage message = ISerializerTestsData.GenerateMessage(); ISerializer jsonSerialiser = new JSONSerialiser(); jsonSerialiser.Serialize(message); }
public void BinaryFormatter_Serialisation_DoesntThrow() { IBaseMessage message = ISerializerTestsData.GenerateMessage(); ISerializer binaryFormatter = new BinaryFormatter(); binaryFormatter.Serialize(message); }
public void JSONSerialiser_Deserialisation_DoesntThrowOnValidData() { IBaseMessage message = ISerializerTestsData.GenerateMessage(); ISerializer jsonSerialiser = new JSONSerialiser(); byte[] messageBytes = jsonSerialiser.Serialize(message); IBaseMessage messageDeserialized = jsonSerialiser.Deserialize(messageBytes); Assert.AreEqual(message.To, messageDeserialized.To); Assert.AreEqual(message.From, messageDeserialized.From); Assert.AreEqual(message.Type, messageDeserialized.Type); Assert.AreEqual(message.Version, messageDeserialized.Version); }
public void BinaryFormatter_Deserialisation_DoesntThrow() { IBaseMessage message = ISerializerTestsData.GenerateMessage(); ISerializer binaryFormatter = new BinaryFormatter(); byte[] messageBytes = binaryFormatter.Serialize(message); IBaseMessage messageDeserialized = binaryFormatter.Deserialize(messageBytes); Assert.AreEqual(message.To, messageDeserialized.To); Assert.AreEqual(message.From, messageDeserialized.From); Assert.AreEqual(message.Type, messageDeserialized.Type); Assert.AreEqual(message.Version, messageDeserialized.Version); }