AWSSDK_DotNet.IntegrationTests.Tests.General.TestCredentials C# (CSharp) Метод

TestCredentials() приватный статический Метод

private static TestCredentials ( ProxyRefreshingAWSCredentials creds, bool expectFailure ) : void
creds ProxyRefreshingAWSCredentials
expectFailure bool
Результат 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);
                }
            }
        }