public void GetAllKeysShouldThrowAnException() { var symmetricTableManager = new SymmetricKeyTableManager(TableName, acct); Action action = () => symmetricTableManager.GetAllKeys(); action.ShouldThrow<AzureCryptoException>(); }
public void GetAllKeysShouldReturnAnEmptyArray() { var symmetricTableManager = new SymmetricKeyTableManager(TableName, acct); symmetricTableManager.CreateTableIfNotExists(); var allKeys = symmetricTableManager.GetAllKeys().ToList(); allKeys.Should().NotBeNull("The get query failed"); allKeys.Count().ShouldBeEquivalentTo(0, "Query returned null or there are items in the table"); }
public void GetAllKeysShouldReturnOneKey() { var symmetricTableManager = new SymmetricKeyTableManager(TableName, acct); symmetricTableManager.CreateTableIfNotExists(); var newKey = rsaHelper.CreateNewAesSymmetricKeyset(); symmetricTableManager.AddSymmetricKey(newKey); var allKeys = symmetricTableManager.GetAllKeys().ToList(); allKeys.Should().NotBeNull("The get query failed"); allKeys.Count().ShouldBeEquivalentTo(1, "Insert operation failed"); }
public void DeleteKeyShouldSucceed() { var symmetricTableManager = new SymmetricKeyTableManager(TableName, acct); symmetricTableManager.CreateTableIfNotExists(); var newKey = rsaHelper.CreateNewAesSymmetricKeyset(); symmetricTableManager.AddSymmetricKey(newKey); var allKeys = symmetricTableManager.GetAllKeys().ToList(); allKeys.Count().ShouldBeEquivalentTo(1, "Insert operation failed"); symmetricTableManager.DeleteSymmetricKey(newKey); allKeys = symmetricTableManager.GetAllKeys().ToList(); allKeys.Count().ShouldBeEquivalentTo(0, "Delete operation failed"); }