public void TestAzureTableCryptoThrowsTableNotFoundException() { var keyStore = new SymmetricKeyCache(rsaHelper, tableManager); var c = new AzureCrypto(keyStore); Action action = () => c.GetEncryptor(); action.ShouldThrow<AzureCryptoException>(); }
public void TestAzureTableCryptoHasValidEncryptor() { var newKey = rsaHelper.CreateNewAesSymmetricKeyset(); tableManager.AddSymmetricKey(newKey); var keyStore = new SymmetricKeyCache(rsaHelper, tableManager); var c = new AzureCrypto(keyStore); c.Should().NotBeNull("At this stage the contstructor should have succeeded"); var encryptor = c.GetEncryptor(); encryptor.Should().NotBeNull("Because the keystore is initialized and there is a key"); }