public async Task should_call_video_api_when_request_is_valid() { var messageHandler = new ParticipantsAddedHandler(VideoApiServiceMock.Object, VideoWebServiceMock.Object); var integrationEvent = GetIntegrationEvent(); await messageHandler.HandleAsync(integrationEvent); VideoApiServiceMock.Verify(x => x.AddParticipantsToConference(It.IsAny <Guid>(), It.IsAny <AddParticipantsToConferenceRequest>()), Times.Once); VideoWebServiceMock.Verify(x => x.PushParticipantsUpdatedMessage(It.IsAny <Guid>(), It.IsAny <UpdateConferenceParticipantsRequest>()), Times.Once); }
public async Task Pushes_New_Conference_Added_Event_To_Video_Web() { var expectedConferenceId = Guid.NewGuid(); var messageHandler = (IMessageHandler) new HearingReadyForVideoHandler(VideoApiServiceMock.Object, VideoWebServiceMock.Object); VideoApiServiceMock.Setup(x => x.BookNewConferenceAsync(It.IsAny <BookNewConferenceRequest>())).ReturnsAsync(new ConferenceDetailsResponse { Id = expectedConferenceId }); var integrationEvent = CreateEvent(); await messageHandler.HandleAsync(integrationEvent); VideoWebServiceMock.Verify(x => x.PushNewConferenceAdded(expectedConferenceId)); }