public void ReturnNullIfSerializingNull() { Serializer <DateTime?> serializer = new NullableDateTimeSerializer(); byte[] actualSerializedValue = serializer.Serialize(null); Assert.Null(actualSerializedValue); }
public void SerializeAndDeserializeToTheSameObject(DateTime?originalValue) { Serializer <DateTime?> serializer = new NullableDateTimeSerializer(); byte[] serializedValue = serializer.Serialize(originalValue); DateTime?deserializedValue = serializer.Deserialize(serializedValue); Assert.Equal(originalValue, deserializedValue); }