Пример #1
0
 public void TestOther2Profile()
 {
     using (new FallbackFactoryTestFixture(ProfileText, "other2"))
     {
         var enabled = FallbackEndpointDiscoveryEnabledFactory.GetEnabled();
         Assert.IsTrue(enabled.HasValue);
         Assert.IsTrue(enabled.Value);
     }
 }
Пример #2
0
        public void TestDefaultProfile()
        {
            using (new FallbackFactoryTestFixture(ProfileText, null))
            {
                var creds = FallbackCredentialsFactory.GetCredentials();
                Assert.AreEqual("default_aws_access_key_id", creds.GetCredentials().AccessKey);

                var region = FallbackRegionFactory.GetRegionEndpoint(false);
                Assert.AreEqual(RegionEndpoint.USWest2, region);

                var enabled = FallbackEndpointDiscoveryEnabledFactory.GetEnabled();
                Assert.IsFalse(enabled.HasValue);
            }
        }
Пример #3
0
        public void TestEnableEndpointDiscoveryEnvVariable()
        {
            var envVariables = new Dictionary <string, string>()
            {
                { AWS_ENABLE_ENDPOINT_DISCOVERY_ENVIRONMENT_VARIABLE, "false" }
            };

            using (new FallbackFactoryTestFixture(ProfileText, "other2", envVariables))
            {
                var enabled = FallbackEndpointDiscoveryEnabledFactory.GetEnabled();
                Assert.IsTrue(enabled.HasValue);
                Assert.IsFalse(enabled.Value);

                enabled = FallbackInternalConfigurationFactory.EndpointDiscoveryEnabled;
                Assert.IsTrue(enabled.HasValue);
                Assert.IsFalse(enabled.Value);
            }
        }
Пример #4
0
        public void TestOtherProfile()
        {
            using (new FallbackFactoryTestFixture(ProfileText, "other"))
            {
                var creds = FallbackCredentialsFactory.GetCredentials();
                Assert.AreEqual("other_aws_access_key_id", creds.GetCredentials().AccessKey);

                var region = FallbackRegionFactory.GetRegionEndpoint(false);
                Assert.AreEqual(RegionEndpoint.USWest1, region);

                var enabled = FallbackEndpointDiscoveryEnabledFactory.GetEnabled();
                Assert.IsTrue(enabled.HasValue);
                Assert.IsFalse(enabled.Value);

                enabled = FallbackInternalConfigurationFactory.EndpointDiscoveryEnabled;
                Assert.IsTrue(enabled.HasValue);
                Assert.IsFalse(enabled.Value);
            }
        }
Пример #5
0
        public void TestDefaultProfile()
        {
            using (new FallbackFactoryTestFixture(ProfileText, null))
            {
                var creds = FallbackCredentialsFactory.GetCredentials();
                Assert.AreEqual("default_aws_access_key_id", creds.GetCredentials().AccessKey);

                var region = FallbackRegionFactory.GetRegionEndpoint(false);
                Assert.AreEqual(RegionEndpoint.USWest2, region);

                var enabled = FallbackEndpointDiscoveryEnabledFactory.GetEnabled();
                Assert.IsFalse(enabled.HasValue);

                enabled = FallbackInternalConfigurationFactory.EndpointDiscoveryEnabled;
                Assert.IsFalse(enabled.HasValue);

                var retryMode = FallbackInternalConfigurationFactory.RetryMode;
                Assert.IsFalse(retryMode.HasValue);

                var maxAttempts = FallbackInternalConfigurationFactory.MaxAttempts;
                Assert.IsFalse(maxAttempts.HasValue);
            }
        }