private static TestCredentials ( ProxyRefreshingAWSCredentials creds, bool expectFailure ) : void | ||
creds | ProxyRefreshingAWSCredentials | |
expectFailure | bool | |
return | void |
private static void TestCredentials(ProxyRefreshingAWSCredentials creds, bool expectFailure)
{
using (var client = new AmazonS3Client(creds))
{
try
{
client.ListBuckets();
Assert.IsFalse(expectFailure);
}
catch (AmazonClientException ace)
{
Assert.IsTrue(expectFailure);
Assert.IsNotNull(ace);
Assert.IsNotNull(ace.Message);
Assert.IsTrue(ace.Message.IndexOf("already") >= 0);
}
}
}