Beispiel #1
0
 public void UpdateProfileDifferentType()
 {
     using (var tester = new SharedCredentialsFileTestFixture())
     {
         tester.AssertWriteProfile("updated_profile", UpdatedProfileTypeOptionsBefore,
                                   UpdatedProfileTypePropertiesBeforeAndAfter, UpdatedProfileTypeTextBefore);
         tester.AssertWriteProfile("updated_profile", UpdatedProfileTypeOptionsAfter,
                                   UpdatedProfileTypePropertiesBeforeAndAfter, UpdatedProfileTypeTextAfter);
     }
 }
Beispiel #2
0
 public void WriteEndpointDiscoveryEnabledOnlyProfile()
 {
     using (var tester = new SharedCredentialsFileTestFixture())
     {
         tester.AssertWriteProfile("endpoint_discovery_enabled_only_profile", EndpointDiscoveryEnabledOnlyProfileOptions, true, EndpointDiscoveryEnabledOnlyProfileText);
     }
 }
Beispiel #3
0
 public void WriteRegionOnlyProfile()
 {
     using (var tester = new SharedCredentialsFileTestFixture(RegionOnlyProfileText))
     {
         tester.AssertWriteProfile("region_only_profile", RegionOnlyProfileOptions, RegionOnlyProfileText);
     }
 }
Beispiel #4
0
 public void WriteAssumeRoleMfaProfile()
 {
     using (var tester = new SharedCredentialsFileTestFixture())
     {
         tester.AssertWriteProfile("assume_role_mfa_profile", AssumeRoleMfaProfileOptions, AssumeRoleMfaProfileText);
     }
 }
Beispiel #5
0
 public void WriteSessionProfile()
 {
     using (var tester = new SharedCredentialsFileTestFixture())
     {
         tester.AssertWriteProfile("session_profile", SessionProfileOptions, SessionProfileText);
     }
 }
Beispiel #6
0
 public void WriteBasicProfile()
 {
     using (var tester = new SharedCredentialsFileTestFixture())
     {
         tester.AssertWriteProfile("basic_profile", BasicProfileOptions, RegionEndpoint.CACentral1, UniqueKey, BasicProfileCredentialsText);
     }
 }
Beispiel #7
0
 public void UpdateProfileWithProperties()
 {
     using (var tester = new SharedCredentialsFileTestFixture(UpdatedProfileWithPropertiesTextBefore))
     {
         tester.ReadAndAssertProfile("basic_profile", UpdatedProfileWithPropertiesOptions, UpdatedProfileWithPropertiesBefore);
         tester.AssertWriteProfile("basic_profile", UpdatedProfileWithPropertiesOptions, UpdatedProfileWithPropertiesAfter, UpdatedProfileWithPropertiesTextAfter);
     }
 }
Beispiel #8
0
 public void UpdateProfile()
 {
     using (var tester = new SharedCredentialsFileTestFixture(SessionProfileText))
     {
         tester.ReadAndAssertProfile("session_profile", SessionProfileOptions);
         tester.AssertWriteProfile("session_profile", SessionProfileOptionsUpdated, SessionProfileTextUpdated);
     }
 }
Beispiel #9
0
 public void WriteUnsupportedProfileType()
 {
     using (var tester = new SharedCredentialsFileTestFixture())
     {
         AssertExtensions.ExpectException(() =>
         {
             tester.AssertWriteProfile("saml_role_profile", SAMLRoleProfileOptions, null);
         }, typeof(ArgumentException), new Regex("SharedCredentialsFile does not support the SAMLRoleUserIdentity profile type."));
     }
 }
Beispiel #10
0
 public void WriteInvalidProfile()
 {
     using (var tester = new SharedCredentialsFileTestFixture(InvalidProfileText))
     {
         AssertExtensions.ExpectException(() =>
         {
             tester.AssertWriteProfile("invalid_profile", InvalidProfileOptions, InvalidProfileText);
         }, typeof(ArgumentException), new Regex("The CredentialProfile provided is not a valid profile."));
     }
 }
Beispiel #11
0
 private void TestReservedProperty(string propertyName)
 {
     using (var tester = new SharedCredentialsFileTestFixture())
     {
         var properties = new Dictionary <string, string>()
         {
             { propertyName, "aargh!" }
         };
         AssertExtensions.ExpectException(() =>
         {
             tester.AssertWriteProfile("basic_profile", BasicProfileOptions, properties, BasicProfileCredentialsText);
         }, typeof(ArgumentException), "The profile properties dictionary cannot contain a key named " + propertyName +
                                          " because it is in the name mapping dictionary.");
     }
 }