public async Task StartAdhocMeetingShouldReturnATaskToWaitForInvitationStartedEvent() { // Given m_messagingInvitation = await StartIncomingMessagingInvitationAsync("Event_IncomingIMCall.json").ConfigureAwait(false); var invitationOperationid = string.Empty; m_restfulClient.HandleRequestProcessed += (sender, args) => { string operationId = TestHelper.RaiseEventsOnHttpRequest(args, DataUrls.StartAdhocMeeting, HttpMethod.Post, null, null); if (!string.IsNullOrEmpty(operationId)) { invitationOperationid = operationId; } }; Task invitationTask = m_messagingInvitation.StartAdhocMeetingAsync("Test subject", "https://example.com/callback", m_loggingContext); await Task.Delay(TimeSpan.FromMilliseconds(200)).ConfigureAwait(false); Assert.IsFalse(invitationTask.IsCompleted); // When TestHelper.RaiseEventsFromFileWithOperationId(m_mockEventChannel, "Event_OnlineMeetingInvitationStarted.json", invitationOperationid); // Then Assert.IsTrue(invitationTask.IsCompleted); }
public async Task StartAdhocMeetingShouldThrowIfCapabilityNotAvailable() { // Given m_messagingInvitation = await StartIncomingMessagingInvitationAsync("Event_IncomingIMCall_NoActionLinks.json").ConfigureAwait(false); // When await m_messagingInvitation.StartAdhocMeetingAsync("Test subject", "https://example.com/callback", m_loggingContext).ConfigureAwait(false); // Then // Exception is thrown }
public async Task StartAdhocMeetingShouldThrowIfAdhocMeetingStartedEventNotReceived() { // Given m_messagingInvitation = await StartIncomingMessagingInvitationAsync("Event_IncomingIMCall.json").ConfigureAwait(false); ((MessagingInvitation)m_messagingInvitation).WaitForEvents = TimeSpan.FromMilliseconds(300); // When await m_messagingInvitation.StartAdhocMeetingAsync("Test subject", "https://example.com/callback", m_loggingContext).ConfigureAwait(false); // Then // Exception is thrown }
public async Task StartAdhocMeetingShouldMakeTheHttpRequest() { // Given m_messagingInvitation = await StartIncomingMessagingInvitationAsync("Event_IncomingIMCall.json").ConfigureAwait(false); m_restfulClient.HandleRequestProcessed += (sender, args) => TestHelper.RaiseEventsOnHttpRequest(args, DataUrls.StartAdhocMeeting, HttpMethod.Post, "Event_OnlineMeetingInvitationStarted.json", m_mockEventChannel); // When await m_messagingInvitation.StartAdhocMeetingAsync("Test subject", "https://example.com/callback", m_loggingContext).ConfigureAwait(false); // Then Assert.IsTrue(m_restfulClient.RequestsProcessed("POST " + DataUrls.StartAdhocMeeting)); }
public async Task StartAdhocMeetingShouldWorkWithNullLoggingContext() { // Given m_messagingInvitation = await StartIncomingMessagingInvitationAsync("Event_IncomingIMCall.json").ConfigureAwait(false); m_restfulClient.HandleRequestProcessed += (sender, args) => TestHelper.RaiseEventsOnHttpRequest(args, DataUrls.StartAdhocMeeting, HttpMethod.Post, "Event_OnlineMeetingInvitationStarted.json", m_mockEventChannel); // When await m_messagingInvitation.StartAdhocMeetingAsync("Test subject", "https://example.com/callback", null).ConfigureAwait(false); // Then // No exception is thrown }
public async Task StartAdhocMeetingShouldNotPassCallbackContextInTheHttpRequest() { // Given var callbackContextNotPassed = false; m_messagingInvitation = await StartIncomingMessagingInvitationAsync("Event_IncomingIMCall.json").ConfigureAwait(false); m_restfulClient.HandleRequestProcessed += (sender, args) => { var operationId = TestHelper.RaiseEventsOnHttpRequest(args, DataUrls.StartAdhocMeeting, HttpMethod.Post, "Event_OnlineMeetingInvitationStarted.json", m_mockEventChannel); if (operationId != null) { var input = args.Input as StartAdhocMeetingInput; callbackContextNotPassed = input.CallbackContext == null; } }; // When await m_messagingInvitation.StartAdhocMeetingAsync("Test subject", "https://example.com/callback", m_loggingContext).ConfigureAwait(false); // Then Assert.IsTrue(callbackContextNotPassed); }