public void CanNotConnectToCrowdApi_GetRolesByUser()
        {
            SetUpConnectionToAnUnboundPort();

            Action act = () => _crowdAuthenticatedUserClient.GetRolesByUser(new IdentityUser {
                UserName = _userName
            });

            ShouldBeUnableToConnect(act);
        }
        public IEnumerable <AwsProfile> GetProfilesForUser(string username)
        {
            IdentityUser         user = _authClient.GetUserByName(username);
            IEnumerable <string> currentUsersRoles = _authClient.GetRolesByUser(user);

            List <AwsProfile> profiles = _profileRepository.FindAll().ToList();

            List <AwsProfile> userProfiles = currentUsersRoles
                                             .SelectMany(role => profiles.FindAll(x => x.Groups.Contains(role)))
                                             .DistinctBy(x => x.Name)
                                             .ToList();

            return(userProfiles);
        }