public async Task Will_Return_A_Role_If_CreateRoleAsync_Response_Is_Ok()
        {
            // Arrange
            var role = new Role();
            var createRoleResponse = new CreateRoleResponse();

            createRoleResponse.HttpStatusCode = HttpStatusCode.OK;
            createRoleResponse.Role           = role;
            var amazonIdentityManagementServiceStubBuilder = new AmazonIdentityManagementServiceStubBuilder();


            var getCallerIdentityResponse = new GetCallerIdentityResponse();

            getCallerIdentityResponse.Account = "AccountDoesNotMatter";
            var amazonSecurityTokenServiceStubBuilder = new AmazonSecurityTokenServiceStubBuilder();
            var roleName = "doesNotMatter";

            var identityManagementClient = new IdentityManagementServiceClientStub();

            var sut = new AwsIdentityCommandClient(
                amazonIdentityManagementServiceStubBuilder.WithCreateRoleResponse(createRoleResponse),
                amazonSecurityTokenServiceStubBuilder.WithGetCallerIdentityResponse(getCallerIdentityResponse),
                new PolicyTemplateRepositoryStub(),
                identityManagementClient
                );


            // Act
            var resultRole = await sut.PutRoleAsync(new RoleName(roleName));


            // Assert
            Assert.Same(role, resultRole);
        }
        public async Task Will_Throw_A_Exception_If_CreateRoleAsync_Response_Is_Not_Ok()
        {
            // Arrange
            var createRoleResponse = new CreateRoleResponse();

            createRoleResponse.HttpStatusCode   = HttpStatusCode.ServiceUnavailable;
            createRoleResponse.ResponseMetadata = new ResponseMetadata();
            createRoleResponse.ResponseMetadata.Metadata["foo"] = "bar";

            var amazonIdentityManagementServiceStubBuilder = new AmazonIdentityManagementServiceStubBuilder();

            var getCallerIdentityResponse = new GetCallerIdentityResponse();

            getCallerIdentityResponse.Account = "AccountDoesNotMatter";
            var amazonSecurityTokenServiceStubBuilder = new AmazonSecurityTokenServiceStubBuilder();
            var roleName = "doesNotMatter";

            var identityManagementClient = new IdentityManagementServiceClientStub();


            var sut = new AwsIdentityCommandClient(
                amazonIdentityManagementServiceStubBuilder.WithCreateRoleResponse(createRoleResponse),
                amazonSecurityTokenServiceStubBuilder.WithGetCallerIdentityResponse(getCallerIdentityResponse),
                new PolicyTemplateRepositoryStub(),
                identityManagementClient
                );

            // Act / Assert
            await Assert.ThrowsAsync <Exception>(() => sut.PutRoleAsync(new RoleName(roleName)));
        }