public async Task Update_SpecialEpisode_ShouldSaveMetadata() { // Arrange const string path = @"C:\Folder\TV Shows\Game of Thrones\Specials\0x02.mkv"; EpisodeMetadata metadata = CreateEpisodeMetadata(0, "Specials"); _metadataUpdater.GetEpisodeMetadata("123", 0, 2) .Returns(metadata.ToTask()); _fileInformationService.GetVideoFileInformation(path) .Returns(CreateFileInformation()); // Act await _service.Update(path, "123"); // Assert _metadataRepository.Received() .Save(path, metadata).Async(); }
private async Task <EpisodeMetadata> GetMetadata(string episodeFile, string serieId, EpisodeNumber episode) { try { return(await _metadataUpdater.GetEpisodeMetadata(serieId, episode.SeasonNumber, episode.EpisodeSeasonNumber)); } catch (ApiException) { throw new EpisodeNotFoundException(episodeFile); } }