Example #1
0
        public void should_map_hearing_dto_to_book_new_conference_request()
        {
            var hearingDto   = CreateHearingDto();
            var participants = Builder <ParticipantDto> .CreateListOfSize(4)
                               .TheFirst(1).With(x => x.UserRole = UserRole.Judge.ToString())
                               .TheNext(2).With(x => x.UserRole  = UserRole.Individual.ToString())
                               .TheRest().With(x => x.UserRole   = UserRole.Representative.ToString())
                               .Build();

            var endpoints = CreateEndpoints(participants);

            var request = HearingToBookConferenceMapper
                          .MapToBookNewConferenceRequest(hearingDto, participants, endpoints);

            request.Should().NotBeNull();
            request.Should().BeEquivalentTo(hearingDto, options =>
                                            options
                                            .Excluding(o => o.HearingId).ExcludingMissingMembers()
                                            );
            request.AudioRecordingRequired.Should().Be(hearingDto.RecordAudio);
            request.HearingRefId.Should().Be(hearingDto.HearingId);
            request.Participants.Count.Should().Be(participants.Count);
            request.Endpoints.Count.Should().Be(endpoints.Count);
            request.Endpoints.First(x => x.DisplayName == "one").DefenceAdvocate.Should().NotBeEmpty();
        }
        public async Task HandleAsync(HearingIsReadyForVideoIntegrationEvent eventMessage)
        {
            var request = HearingToBookConferenceMapper.MapToBookNewConferenceRequest(eventMessage.Hearing,
                                                                                      eventMessage.Participants, eventMessage.Endpoints);

            await _videoApiService.BookNewConferenceAsync(request);
        }