public void DeserializeTheSameAsSqlServer(decimal plaintext)
        {
            Database.Insert(new SqlParameter("@parameter", SqlDbType.SmallMoney)
            {
                Value = plaintext
            });
            byte[] ciphertextBytes             = Database.SelectCiphertext(SqlDbType.SmallMoney);
            byte[] plaintextBytes              = deterministicEncryptionAlgorithm.Decrypt(ciphertextBytes);
            SqlSmallmoneySerializer serializer = new SqlSmallmoneySerializer();
            decimal expectedPlaintext          = serializer.Deserialize(plaintextBytes);
            decimal actualPlaintext            = (decimal)Database.SelectPlaintext(SqlDbType.SmallMoney);

            Assert.Equal(expectedPlaintext, actualPlaintext);
        }
        public void ShouldThrowIfDeserializingLessThanEightBytes(byte[] data)
        {
            SqlSmallmoneySerializer serializer = new SqlSmallmoneySerializer();

            Assert.Throws <ArgumentOutOfRangeException>(() => serializer.Deserialize(data));
        }
        public void ShouldThrowIfDeserializingNull()
        {
            SqlSmallmoneySerializer serializer = new SqlSmallmoneySerializer();

            Assert.Throws <ArgumentNullException>(() => serializer.Deserialize(null));
        }