//[ExpectedException(typeof(NoSuchEntityException))]
public void TestDeleteNonExistentAccessKeyException()
{
string username = IAMUtil.CreateTestUser(Client);
try
{
CreateAccessKeyResponse response =
Client.CreateAccessKeyAsync(new CreateAccessKeyRequest()
{
UserName = username
}).Result;
string keyId = response.AccessKey.AccessKeyId;
Client.DeleteAccessKeyAsync(new DeleteAccessKeyRequest()
{
UserName = username, AccessKeyId = keyId
}).Wait();
Client.DeleteAccessKeyAsync(new DeleteAccessKeyRequest()
{
UserName = username, AccessKeyId = keyId
}).Wait();
}
catch (AggregateException ae)
{
AssertExtensions.VerifyException <NoSuchEntityException>(ae);
}
finally
{
IAMUtil.DeleteTestUsers(Client, username);
}
}