public async Task LoadFrom_CreatesSourceData() { var loader = new TvDbSeriesFromTvDbEpisode(this.sources); var result = await loader.LoadFrom(this.mediaItem, null); result.IsRight.Should().BeTrue(); result.IfRight(sd => sd.Data.Should().Be(this.tvDbSeriesData)); result.IfRight(sd => sd.Source.Should().BeEquivalentTo(this.sources.TvDb.ForAdditionalData())); result.IfRight(sd => sd.Identifier.Should().BeEquivalentTo(new ItemIdentifier(67, Option <int> .None, "Title"))); }
public async Task LoadFrom_NoMatchingSeries_Fails() { this.tvDbSource.GetSeriesData(this.mediaItem.EmbyData, Arg.Any <ProcessResultContext>()) .Returns(Left <ProcessFailedResult, TvDbSeriesData>(new ProcessFailedResult(string.Empty, string.Empty, MediaItemTypes.Series, "Failed to find series in TvDb"))); var loader = new TvDbSeriesFromTvDbEpisode(this.sources); var result = await loader.LoadFrom(this.mediaItem, null); result.IsLeft.Should().BeTrue(); result.IfLeft(f => f.Reason.Should().Be("Failed to find series in TvDb")); }