public async Task Should_close_conference_and_not_call_delete_audio_recording_application_if_audio_required_set_to_false_for_given_conference()
        {
            var response = new AudioPlatformServiceResponse(true);

            AudioPlatformServiceMock.Setup(v => v.DeleteAudioApplicationAsync(It.IsAny <Guid>())).ReturnsAsync(response);
            await Controller.CloseConferenceAsync(Guid.NewGuid());

            CommandHandlerMock.Verify(c => c.Handle(It.IsAny <CloseConferenceCommand>()), Times.Once);
            AudioPlatformServiceMock.Verify(v => v.DeleteAudioApplicationAsync(It.IsAny <Guid>()), Times.Never);
        }
        public async Task Should_book_kinly_conference_and_update_meeting_room_for_given_conference_id()
        {
            var audioPlatformServiceResponse = new AudioPlatformServiceResponse(true)
            {
                IngestUrl = "http://myIngestUrl.com"
            };

            SetupCallToMockRetryService(audioPlatformServiceResponse);
            VideoPlatformServiceMock.Setup(v => v.BookVirtualCourtroomAsync(It.IsAny <Guid>(), It.IsAny <bool>(), audioPlatformServiceResponse.IngestUrl, It.IsAny <IEnumerable <EndpointDto> >())).ReturnsAsync(MeetingRoom);

            await Controller.BookKinlyMeetingRoomAsync(Guid.NewGuid(), true, audioPlatformServiceResponse.IngestUrl, new EndpointDto[] {});

            VideoPlatformServiceMock.Verify(v => v.BookVirtualCourtroomAsync(It.IsAny <Guid>(), It.IsAny <bool>(), audioPlatformServiceResponse.IngestUrl, It.IsAny <IEnumerable <EndpointDto> >()), Times.Once);
            CommandHandlerMock.Verify(c => c.Handle(It.IsAny <UpdateMeetingRoomCommand>()), Times.Once);
        }
        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);
        }