public async Task Should_close_conference_and_delete_audio_recording_application_if_audio_files_exist_and_actual_start_date_is_null() { TestConference.AudioRecordingRequired = true; QueryHandlerMock .Setup(x => x.Handle <GetConferenceByIdQuery, VideoApi.Domain.Conference>(It.IsAny <GetConferenceByIdQuery>())) .ReturnsAsync(TestConference); var response = new AudioPlatformServiceResponse(true); AudioPlatformServiceMock.Setup(v => v.DeleteAudioApplicationAsync(It.IsAny <Guid>())).ReturnsAsync(response); AzureStorageServiceFactoryMock.Setup(x => x.Create(AzureStorageServiceType.Vh)).Returns(AzureStorageServiceMock.Object); AzureStorageServiceMock.Setup(x => x.GetAllBlobNamesByFilePathPrefix(It.IsAny <string>())) .ReturnsAsync(new List <string> { $"{TestConference.HearingRefId.ToString()}.mp4" }); await Controller.CloseConferenceAsync(Guid.NewGuid()); CommandHandlerMock.Verify(c => c.Handle(It.IsAny <CloseConferenceCommand>()), Times.Once); AudioPlatformServiceMock.Verify(v => v.DeleteAudioApplicationAsync(It.IsAny <Guid>()), Times.Once); }
public async Task Should_close_conference_and_not_call_delete_audio_recording_application_if_audio_recording_file_not_found() { TestConference.AudioRecordingRequired = true; TestConference.UpdateConferenceStatus(VideoApi.Domain.Enums.ConferenceState.InSession); QueryHandlerMock .Setup(x => x.Handle <GetConferenceByIdQuery, VideoApi.Domain.Conference>(It.IsAny <GetConferenceByIdQuery>())) .ReturnsAsync(TestConference); AzureStorageServiceFactoryMock.Setup(x => x.Create(AzureStorageServiceType.Vh)).Returns(AzureStorageServiceMock.Object); AudioPlatformServiceMock.Reset(); AzureStorageServiceMock.Reset(); AzureStorageServiceMock.Setup(x => x.GetAllBlobNamesByFilePathPrefix(It.IsAny <string>())).ReturnsAsync(new List <string>()); await Controller.CloseConferenceAsync(Guid.NewGuid()); CommandHandlerMock.Verify(c => c.Handle(It.IsAny <CloseConferenceCommand>()), Times.Once); AzureStorageServiceMock.Verify(x => x.GetAllBlobNamesByFilePathPrefix(It.IsAny <string>()), Times.Once); AudioPlatformServiceMock.Verify(v => v.DeleteAudioApplicationAsync(It.IsAny <Guid>()), Times.Never); }