public async Task DeleteAudioNote_InvalidAudioId_AudioNotFound()
        {
            // arrange
            var service = new AudioService(new FakeBlobRepository(), new Mock <IAudioTranscriptionService>().Object, new Mock <IEventGridPublisherService>().Object);

            // act
            await service.DeleteAudioNoteAsync("invalidaudioid", "fakeuserid");

            // assert
            // no exception thrown
        }
        public async Task DeleteAudioNote_IncorrectUserId_AudioNotFound()
        {
            // arrange
            var fakeBlobRepository = new FakeBlobRepository();

            fakeBlobRepository.AddFakeBlob(AudioService.AudioBlobContainerName, "fakeuserid/fakeid");
            var service = new AudioService(fakeBlobRepository, new Mock <IAudioTranscriptionService>().Object, new Mock <IEventGridPublisherService>().Object);

            // act
            await service.DeleteAudioNoteAsync("fakeid", "fakeuserid");

            // assert
            // no exception thrown
        }
        public async Task DeleteAudioNote_DeletesBlob()
        {
            // arrange
            var fakeBlobRepository = new FakeBlobRepository();

            fakeBlobRepository.AddFakeBlob(AudioService.AudioBlobContainerName, "fakeuserid/fakeid");
            var service = new AudioService(fakeBlobRepository, new Mock <IAudioTranscriptionService>().Object, new Mock <IEventGridPublisherService>().Object);

            // act
            await service.DeleteAudioNoteAsync("fakeid", "fakeuserid");

            // assert
            Assert.Empty(fakeBlobRepository.Blobs);
        }
        public async Task DeleteAudioNote_PublishesAudioDeletedEventToEventGrid()
        {
            // arrange
            var fakeBlobRepository = new FakeBlobRepository();

            fakeBlobRepository.AddFakeBlob(AudioService.AudioBlobContainerName, "fakeuserid/fakeid");
            var mockEventGridPublisherService = new Mock <IEventGridPublisherService>();
            var service = new AudioService(fakeBlobRepository, new Mock <IAudioTranscriptionService>().Object, mockEventGridPublisherService.Object);

            // act
            await service.DeleteAudioNoteAsync("fakeid", "fakeuserid");

            // assert
            mockEventGridPublisherService.Verify(m =>
                                                 m.PostEventGridEventAsync(EventTypes.Audio.AudioDeleted,
                                                                           "fakeuserid/fakeid",
                                                                           It.IsAny <AudioDeletedEventData>()),
                                                 Times.Once);
        }