public void should_map_to_leave_consultation_request()
        {
            var request = Builder <LeavePrivateConsultationRequest> .CreateNew()
                          .With(x => x.ConferenceId  = Guid.NewGuid())
                          .With(x => x.ParticipantId = Guid.NewGuid())
                          .Build();

            var result = LeavePrivateConsultationRequestMapper.MapToLeaveConsultationRequest(request);

            result.Conference_id.Should().Be(request.ConferenceId);
            result.Participant_id.Should().Be(request.ParticipantId);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> LeavePrivateConsultationAsync(LeavePrivateConsultationRequest request)
        {
            try
            {
                var conference = await GetConference(request.ConferenceId);

                var participant = conference.Participants?.SingleOrDefault(x => x.Id == request.ParticipantId);
                if (participant == null)
                {
                    return(NotFound());
                }

                var mappedRequest = LeavePrivateConsultationRequestMapper.MapToLeaveConsultationRequest(request);
                await _videoApiClient.LeavePrivateConsultationAsync(mappedRequest);

                return(NoContent());
            }
            catch (VideoApiException e)
            {
                return(StatusCode(e.StatusCode, e.Response));
            }
        }