public void Should_update_close_time_when_updating_status_to_closed()
        {
            var beforeActionTime = DateTime.UtcNow;
            var conference       = new ConferenceBuilder()
                                   .WithParticipant(UserRole.Individual, "Claimant")
                                   .Build();

            conference.GetCurrentStatus().Should().Be(ConferenceState.NotStarted);
            conference.ClosedDateTime.Should().BeNull();
            conference.CloseConference();
            conference.ClosedDateTime.Should().NotBeNull();
            conference.ClosedDateTime.Value.Should().BeAfter(beforeActionTime);
            conference.GetCurrentStatus().Should().Be(ConferenceState.Closed);
        }
        public void Should_add_conference_status()
        {
            var conference = new ConferenceBuilder()
                             .WithParticipant(UserRole.Individual, "Claimant")
                             .Build();

            conference.GetCurrentStatus().Should().Be(ConferenceState.NotStarted);
            var beforeCount = conference.GetConferenceStatuses().Count;

            conference.CloseConference();
            var afterCount = conference.GetParticipants().Count;

            afterCount.Should().BeGreaterThan(beforeCount);

            conference.GetCurrentStatus().Should().Be(ConferenceState.Closed);
        }
Example #3
0
        public void Should_map_all_properties()
        {
            var conference = new ConferenceBuilder()
                             .WithConferenceStatus(ConferenceState.InSession)
                             .WithConferenceStatus(ConferenceState.Paused)
                             .WithConferenceStatus(ConferenceState.Closed)
                             .WithMeetingRoom("https://poc.node.com", "*****@*****.**")
                             .WithParticipants(3)
                             .WithMessages(5)
                             .WithInterpreterRoom()
                             .Build();

            var pexipSelfTestNode = "*****@*****.**";
            var response          = ConferenceToDetailsResponseMapper.MapConferenceToResponse(conference, pexipSelfTestNode);

            response.Should().BeEquivalentTo(conference, options => options
                                             .Excluding(x => x.HearingRefId)
                                             .Excluding(x => x.Participants)
                                             .Excluding(x => x.ConferenceStatuses)
                                             .Excluding(x => x.State)
                                             .Excluding(x => x.InstantMessageHistory)
                                             .Excluding(x => ExcludeIdFromMessage(x))
                                             .Excluding(x => x.IngestUrl)
                                             .Excluding(x => x.ActualStartTime)
                                             .Excluding(x => x.Endpoints)
                                             .Excluding(x => x.CreatedDateTime)
                                             .Excluding(x => x.Rooms)
                                             );

            response.StartedDateTime.Should().HaveValue().And.Be(conference.ActualStartTime);
            response.ClosedDateTime.Should().HaveValue().And.Be(conference.ClosedDateTime);
            response.CurrentStatus.Should().BeEquivalentTo(conference.GetCurrentStatus());

            var participants = conference.GetParticipants();

            response.Participants.Should().BeEquivalentTo(participants, options => options
                                                          .Excluding(x => x.ParticipantRefId)
                                                          .Excluding(x => x.TestCallResultId)
                                                          .Excluding(x => x.TestCallResult)
                                                          .Excluding(x => x.CurrentConsultationRoomId)
                                                          .Excluding(x => x.CurrentConsultationRoom)
                                                          .Excluding(x => x.CurrentRoom)
                                                          .Excluding(x => x.State)
                                                          .Excluding(x => x.LinkedParticipants)
                                                          .Excluding(x => x.RoomParticipants)
                                                          );

            var civilianRoom = response.CivilianRooms.First();
            var room         = conference.Rooms.First();

            civilianRoom.Id.Should().Be(room.Id);
            civilianRoom.Label.Should().Be(room.Label);
            civilianRoom.Participants.Select(x => x).Should()
            .BeEquivalentTo(room.RoomParticipants.Select(x => x.ParticipantId));
        }
Example #4
0
        public void Should_map_all_properties()
        {
            var conference = new ConferenceBuilder()
                             .WithConferenceStatus(ConferenceState.InSession)
                             .WithConferenceStatus(ConferenceState.Paused)
                             .WithConferenceStatus(ConferenceState.Closed)
                             .WithMeetingRoom("https://poc.node.com", "*****@*****.**")
                             .WithParticipants(3)
                             .WithMessages(5)
                             .Build();

            var pexipSelfTestNode = "*****@*****.**";
            var response          = ConferenceToDetailsResponseMapper.MapConferenceToResponse(conference, pexipSelfTestNode);

            response.Should().BeEquivalentTo(conference, options => options
                                             .Excluding(x => x.HearingRefId)
                                             .Excluding(x => x.Participants)
                                             .Excluding(x => x.ConferenceStatuses)
                                             .Excluding(x => x.State)
                                             .Excluding(x => x.InstantMessageHistory)
                                             .Excluding(x => ExcludeIdFromMessage(x))
                                             .Excluding(x => x.IngestUrl)
                                             .Excluding(x => x.ActualStartTime)
                                             .Excluding(x => x.Endpoints)
                                             );

            response.StartedDateTime.Should().HaveValue().And.Be(conference.ActualStartTime);
            response.ClosedDateTime.Should().HaveValue().And.Be(conference.ClosedDateTime);
            response.CurrentStatus.Should().BeEquivalentTo(conference.GetCurrentStatus());

            var participants = conference.GetParticipants();

            response.Participants.Should().BeEquivalentTo(participants, options => options
                                                          .Excluding(x => x.ParticipantRefId)
                                                          .Excluding(x => x.TestCallResultId)
                                                          .Excluding(x => x.TestCallResult)
                                                          .Excluding(x => x.CurrentRoom)
                                                          .Excluding(x => x.State)
                                                          );
        }
Example #5
0
        public void Should_map_all_properties()
        {
            var conference = new ConferenceBuilder()
                             .WithConferenceStatus(ConferenceState.InSession)
                             .WithConferenceStatus(ConferenceState.Paused)
                             .WithConferenceStatus(ConferenceState.Closed)
                             .WithMeetingRoom("https://poc.node.com", "*****@*****.**")
                             .WithParticipant(UserRole.Judge, "Judge")
                             .WithParticipants(3)
                             .Build();

            const string conferencePhoneNumber = "+441234567890";
            var          configuration         = Builder <KinlyConfiguration> .CreateNew()
                                                 .With(x => x.ConferencePhoneNumber = conferencePhoneNumber).Build();

            var response = ConferenceForAdminResponseMapper.MapConferenceToSummaryResponse(conference, configuration);

            response.Should().BeEquivalentTo(conference, options => options
                                             .Excluding(x => x.HearingRefId)
                                             .Excluding(x => x.Participants)
                                             .Excluding(x => x.ConferenceStatuses)
                                             .Excluding(x => x.State)
                                             .Excluding(x => x.InstantMessageHistory)
                                             .Excluding(x => x.IngestUrl)
                                             .Excluding(x => x.AudioRecordingRequired)
                                             .Excluding(x => x.Id)
                                             .Excluding(x => x.ActualStartTime)
                                             .Excluding(x => x.MeetingRoom)
                                             .Excluding(x => x.Endpoints)
                                             .Excluding(x => x.Rooms)
                                             );

            response.StartedDateTime.Should().Be(conference.ActualStartTime);
            response.Status.Should().BeEquivalentTo(conference.GetCurrentStatus());
            response.ClosedDateTime.Should().HaveValue().And.Be(conference.ClosedDateTime);
            response.TelephoneConferenceId.Should().Be(conference.MeetingRoom.TelephoneConferenceId);
            response.TelephoneConferenceNumber.Should().Be(conferencePhoneNumber);
            response.CreatedDateTime.Should().Be(conference.CreatedDateTime);
        }