Пример #1
0
        public void ReturnNullIfDeserializingNull()
        {
            Serializer <Guid?> serializer = new NullableGuidSerializer();
            Guid?actualDeserializedValue  = serializer.Deserialize(null);

            Assert.Null(actualDeserializedValue);
        }
Пример #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);
        }
Пример #3
0
        public void ShouldThrowIfDeserializingLessThanSixteenBytes(byte[] data)
        {
            Serializer <Guid?> serializer = new NullableGuidSerializer();

            Assert.Throws <ArgumentOutOfRangeException>(() => serializer.Deserialize(data));
        }