private static TestCredentials ( ProxyRefreshingAWSCredentials creds, bool expectFailure ) : System.Threading.Tasks.Task | ||
creds | ProxyRefreshingAWSCredentials | |
expectFailure | bool | |
return | System.Threading.Tasks.Task |
private static async Task TestCredentials(ProxyRefreshingAWSCredentials creds, bool expectFailure)
{
using (var client = new AmazonS3Client(creds))
{
try
{
await client.ListBucketsAsync();
Assert.False(expectFailure);
}
catch (AmazonClientException ace)
{
Assert.True(expectFailure);
Assert.NotNull(ace);
Assert.NotNull(ace.Message);
Assert.True(ace.Message.IndexOf("already") >= 0);
}
}
}