コード例 #1
0
        public void Will_Set_RoleName()
        {
            var accountArn = new AwsAccountArn("foo");
            var roleName   = new RoleName("baa");
            var sut        = new AwsIdentityCommandClient(null, null, null, null);


            // Act
            var assumableRoleRequest = sut.CreateRoleRequest(accountArn, roleName);


            // Assert
            Assert.Equal(roleName, assumableRoleRequest.RoleName);
        }
コード例 #2
0
        //allowed or denied access to a resource. The
        public void Principal_Will_Point_To_Federated_Login()
        {
            var accountArn = new AwsAccountArn("foo");
            var roleName   = new RoleName("baa");
            var sut        = new AwsIdentityCommandClient(null, null, null, null);


            // Act
            var assumableRoleRequest = sut.CreateRoleRequest(accountArn, roleName);


            // Assert
            var expectedSubstring = "Principal\":{\"Federated\":\"arn:aws:iam::foo:saml-provider/ADFS\"}";//@"{""Effect"":""Allow"",""Principal"":{""AWS"":""" + accountArn + @"""}";

            Assert.Contains(expectedSubstring, assumableRoleRequest.AssumeRolePolicyDocument);
        }