Пример #1
0
        public void ReturnNullIfSerializingNull()
        {
            Serializer <Guid?> serializer = new NullableGuidSerializer();

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

            Assert.Null(actualSerializedValue);
        }
Пример #2
0
        public void SerializeAndDeserializeToTheSameObject(Guid?originalValue)
        {
            Serializer <Guid?> serializer = new NullableGuidSerializer();

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

            Assert.Equal(originalValue, deserializedValue);
        }