示例#1
0
        public void ReturnNullIfSerializingNull()
        {
            Serializer <DateTime?> serializer = new NullableDateTimeSerializer();

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

            Assert.Null(actualSerializedValue);
        }
示例#2
0
        public void SerializeAndDeserializeToTheSameObject(DateTime?originalValue)
        {
            Serializer <DateTime?> serializer = new NullableDateTimeSerializer();

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

            Assert.Equal(originalValue, deserializedValue);
        }