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

            Assert.Null(actualDeserializedValue);
        }
        public void DeserializeTheSameAsSqlServer(long?plaintext)
        {
            Database.Insert(new SqlParameter("@parameter", SqlDbType.BigInt)
            {
                Value = plaintext
            });
            byte[]             ciphertextBytes = Database.SelectCiphertext(SqlDbType.BigInt);
            byte[]             plaintextBytes  = deterministicEncryptionAlgorithm.Decrypt(ciphertextBytes);
            Serializer <long?> serializer      = new SqlNullableBigintSerializer();
            long?expectedPlaintext             = serializer.Deserialize(plaintextBytes);
            long?actualPlaintext = (long?)Database.SelectPlaintext(SqlDbType.BigInt);

            Assert.Equal(expectedPlaintext, actualPlaintext);
        }
        public void ShouldThrowIfDeserializingLessThanEightBytes(byte[] data)
        {
            Serializer <long?> serializer = new SqlNullableBigintSerializer();

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