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