Пример #1
0
        private void ShouldInterpretOrRepresentFor(string user, ParticipantDetailsResponse participant, string forUserName)
        {
            var representOrInterpretFor = _browsers[_c.CurrentUser].TextOf(GetParticipantHearingRole(user, participant.Id));

            representOrInterpretFor.Should().Contain($"{participant.HearingRole} for");
            representOrInterpretFor.Should().Contain($"{forUserName}");
        }
        public static ParticipantResponseVho MapParticipantToResponseModel(ParticipantDetailsResponse participant)
        {
            var status = Enum.Parse <ParticipantStatus>(participant.Current_status.ToString());
            var role   = Enum.Parse <Role>(participant.User_role.ToString());

            var response = new ParticipantResponseVho
            {
                Id            = participant.Id,
                Name          = participant.Name,
                Status        = status,
                Role          = role,
                Username      = participant.Username,
                DisplayName   = participant.Display_name,
                CaseTypeGroup = participant.Case_type_group,
                Representee   = participant.Representee,
                HearingRole   = participant.Hearing_role
            };

            if (role == Role.Judge)
            {
                response.TiledDisplayName = $"T{0};{participant.Display_name};{participant.Id}";
            }

            return(response);
        }
        private void AddParticipants(HearingDetailsResponse hearing)
        {
            _response.Participants = new List <ParticipantDetailsResponse>();

            foreach (var participant in hearing.Participants)
            {
                Enum.TryParse(participant.UserRoleName, out UserRole role);
                var response = new ParticipantDetailsResponse()
                {
                    CaseTypeGroup    = participant.UserRoleName,
                    ContactEmail     = participant.ContactEmail,
                    ContactTelephone = participant.Title,
                    CurrentStatus    = ParticipantState.NotSignedIn,
                    DisplayName      = participant.DisplayName,
                    FirstName        = participant.FirstName,
                    HearingRole      = participant.UserRoleName,
                    Id          = participant.Id,
                    LastName    = participant.LastName,
                    Name        = participant.DisplayName,
                    RefId       = participant.Id,
                    Representee = participant.Representee,
                    UserRole    = role,
                    Username    = participant.Username
                };
                _response.Participants.Add(response);
            }
        }
        private void TheToolTipDetailsAreDisplayed(ParticipantDetailsResponse participant, ParticipantResponse hearingParticipant)
        {
            var participantEmailAndRole = $"{participant.Name}";

            _browsers[_c.CurrentUser].TextOf(VhoHearingListPage.ParticipantContactName(participant.Id)).Should().Be(participantEmailAndRole);
            _browsers[_c.CurrentUser].TextOf(VhoHearingListPage.ParticipantContactEmail(participant.Id)).Should().Be(hearingParticipant.ContactEmail);
            _browsers[_c.CurrentUser].TextOf(VhoHearingListPage.ParticipantContactPhone(participant.Id)).Should().Be(hearingParticipant.TelephoneNumber);
        }
Пример #5
0
        private void TheToolTipDetailsAreDisplayed(ParticipantDetailsResponse participant, ParticipantResponse hearingParticipant)
        {
            var participantEmailAndRole = $"{participant.Name} ({participant.Case_type_group})";

            _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.ParticipantContactName(participant.Id)).Text.Trim().Should().Be(participantEmailAndRole);
            _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.ParticipantContactEmail(participant.Id)).Text.Trim().Should().Be(hearingParticipant.Contact_email);
            _browsers[_c.CurrentUser].Driver.WaitUntilVisible(VhoHearingListPage.ParticipantContactPhone(participant.Id)).Text.Trim().Should().Be(hearingParticipant.Telephone_number);
        }
        public void Should_not_be_equal_to_null()
        {
            var instance1 = new ParticipantDetailsResponse();
            ParticipantDetailsResponse instance2 = null;

            var result = instance1.Equals(instance2);

            result.Should().BeFalse();
        }
        public void Should_instances_be_equal()
        {
            var instance1 = new ParticipantDetailsResponse();
            var instance2 = new ParticipantDetailsResponse();

            var result = instance1.Equals(instance2);

            result.Should().BeTrue();
        }
        public void Should_not_be_equal_if_instances_has_different_Id()
        {
            var instance1 = new ParticipantDetailsResponse();
            var instance2 = new ParticipantDetailsResponse();

            instance2.Id = "123";

            var result = instance1.Equals(instance2);

            result.Should().BeFalse();
        }
Пример #9
0
 private string PollForStatusUpdate(ParticipantDetailsResponse participant, string expectedStatus)
 {
     for (var i = 0; i < MaxRetries; i++)
     {
         var status = _browsers[_c.CurrentUser].TextOf(AdminPanelPage.ParticipantStatus(participant.Id));
         if (status.Equals(expectedStatus))
         {
             return(status);
         }
         Thread.Sleep(TimeSpan.FromSeconds(1));
     }
     throw new TimeoutException($"Expected participant status to be updated to {expectedStatus}");
 }
Пример #10
0
        private void VerifyInterpreterOrRepresentative(string user, ParticipantDetailsResponse participant, string forUserName, bool representative = true)
        {
            _browsers[_c.CurrentUser].TextOf(GetParticipantName(user, participant.Id)).Should().Be(participant.Name);
            var invalidCaseType = participant.CaseTypeGroup.ToLower().Equals("none");

            if (invalidCaseType && representative)
            {
                return;
            }

            if (!invalidCaseType)
            {
                _browsers[_c.CurrentUser].TextOf(GetParticipantCaseType(user, participant.Id)).Should().Be(participant.CaseTypeGroup);
            }

            ShouldInterpretOrRepresentFor(user, participant, forUserName);
        }
        private static Participant MapParticipantToCacheModel(ParticipantDetailsResponse participant)
        {
            var links = (participant.LinkedParticipants ?? new List <LinkedParticipantResponse>())
                        .Select(MapLinkedParticipantToCacheModel).ToList();

            return(new Participant
            {
                Id = participant.Id,
                RefId = participant.RefId,
                Name = participant.Name,
                FirstName = participant.FirstName,
                LastName = participant.LastName,
                ContactEmail = participant.ContactEmail,
                ContactTelephone = participant.ContactTelephone,
                DisplayName = participant.DisplayName,
                Role = Enum.Parse <Role>(participant.UserRole.ToString(), true),
                HearingRole = participant.HearingRole,
                ParticipantStatus = Enum.Parse <ParticipantStatus>(participant.CurrentStatus.ToString(), true),
                Username = participant.Username,
                CaseTypeGroup = participant.CaseTypeGroup,
                Representee = participant.Representee,
                LinkedParticipants = links
            });
        }
Пример #12
0
 public static void ParticipantDetails(ParticipantDetailsResponse participant, AddParticipantsToHearingRequest request)
 {
     participant.Should().BeEquivalentTo(request.Participants.First(),
                                         options => options.ExcludingMissingMembers().Excluding(x => x.Representee));
 }