public void ReturnNullIfSerializingNull() { SqlCharSerializer serializer = new SqlCharSerializer(); byte[] actualSerializedValue = serializer.Serialize(null); Assert.Null(actualSerializedValue); }
public void SerializeTheSameAsSqlServer(string plaintext, int size, int codepage) { SqlCharSerializer serializer = new SqlCharSerializer(size, codepage); byte[] serializedPlaintext = serializer.Serialize(plaintext); byte[] actualCiphertext = deterministicEncryptionAlgorithm.Encrypt(serializedPlaintext); Database.Insert(new SqlParameter("@parameter", SqlDbType.Char, size) { Value = plaintext }); byte[] expectedCiphertext = Database.SelectCiphertext(SqlDbType.Char); Assert.Equal(expectedCiphertext, actualCiphertext); }