public void ReturnNullIfDeserializingNull()
        {
            Serializer <bool?> serializer = new NullableBooleanSerializer();
            bool?actualDeserializedValue  = serializer.Deserialize(null);

            Assert.Null(actualDeserializedValue);
        }
        public void SerializeAndDeserializeToTheSameObject(bool?originalValue)
        {
            Serializer <bool?> serializer = new NullableBooleanSerializer();

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

            Assert.Equal(originalValue, deserializedValue);
        }
        public void ThrowIfDeserializingLessThanOneByte()
        {
            Serializer <bool?> serializer = new NullableBooleanSerializer();

            Assert.Throws <ArgumentOutOfRangeException>(() => serializer.Deserialize(new byte[] { }));
        }