public void CanNotConnectToCrowdApi_GetUserByName()
        {
            SetUpConnectionToAnUnboundPort();

            Action act = () => _crowdAuthenticatedUserClient.GetUserByName(_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);
        }