예제 #1
0
        public void ReturnNullIfSerializingNull()
        {
            Serializer <DateTimeOffset?> serializer = new NullableDateTimeOffsetSerializer();

            byte[] actualSerializedValue = serializer.Serialize(null);

            Assert.Null(actualSerializedValue);
        }
예제 #2
0
        public void SerializeAndDeserializeToTheSameObject(DateTimeOffset?originalValue)
        {
            Serializer <DateTimeOffset?> serializer = new NullableDateTimeOffsetSerializer();

            byte[]         serializedValue   = serializer.Serialize(originalValue);
            DateTimeOffset?deserializedValue = serializer.Deserialize(serializedValue);

            Assert.Equal(originalValue, deserializedValue);
        }