public void SerializeAndDeserializeToTheSameObject(double originalValue) { Serializer <double> serializer = new DoubleSerializer(); byte[] serializedValue = serializer.Serialize(originalValue); double deserializedValue = serializer.Deserialize(serializedValue); Assert.Equal(originalValue, deserializedValue); }
public void ShouldThrowIfDeserializingLessThanEightBytes(byte[] data) { Serializer <double> serializer = new DoubleSerializer(); Assert.Throws <ArgumentOutOfRangeException>(() => serializer.Deserialize(data)); }
public void ShouldThrowIfDeserializingNull() { Serializer <double> serializer = new DoubleSerializer(); Assert.Throws <ArgumentNullException>(() => serializer.Deserialize(null)); }