Ejemplo n.º 1
0
        public void Setup()
        {
            _embyData = Substitute.For <IEmbyItemData>();
            _embyData.Identifier.Returns(new ItemIdentifier(0, 0, "Name"));

            _mediaItem = Substitute.For <IMediaItem>();
            _mediaItem.EmbyData.Returns(_embyData);
            _mediaItem.ItemType.Returns(MediaItemTypes.Episode);

            _mappingList = Substitute.For <IMappingList>();

            _sources = Substitute.For <ISources>();

            _aniDbSource = Substitute.For <IAniDbSource>();
            _sources.AniDb.Returns(_aniDbSource);

            var tvDbSource = Substitute.For <ITvDbSource>();

            _sources.TvDb.Returns(tvDbSource);

            _aniDbSourceData = Substitute.For <ISourceData <AniDbSeriesData> >();

            _embyData.GetParentId(MediaItemTypes.Series, _aniDbSource).Returns(Option <int> .Some(3));

            _noMappingResult = new ProcessFailedResult("", "", null, "");
            _mappingList.GetSeriesMappingFromAniDb(Arg.Any <int>(), Arg.Any <ProcessResultContext>())
            .Returns(Left <ProcessFailedResult, ISeriesMapping>(_noMappingResult));
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            _episodeMapper = Substitute.For <IEpisodeMapper>();
            _sources       = Substitute.For <ISources>();
            _mappingList   = Substitute.For <IMappingList>();

            _embyData = Substitute.For <IEmbyItemData>();
            _embyData.Identifier.Returns(new ItemIdentifier(67, 53, "Name"));
            _embyData.Language.Returns("en");

            var aniDbSource = Substitute.For <IAniDbSource>();

            _sources.AniDb.Returns(aniDbSource);

            var tvDbSource = Substitute.For <ITvDbSource>();

            _sources.TvDb.Returns(tvDbSource);

            _tvDbSourceData = Substitute.For <ISourceData <TvDbEpisodeData> >();

            _mediaItem = Substitute.For <IMediaItem>();
            _mediaItem.EmbyData.Returns(_embyData);
            _mediaItem.ItemType.Returns(MediaItemTypes.Episode);

            SetUpTvDbEpisodeData(56, 67, 53);

            _noMappingResult = new ProcessFailedResult("", "", null, "");
            _mappingList.GetSeriesMappingsFromTvDb(Arg.Any <int>(), Arg.Any <ProcessResultContext>())
            .Returns(Left <ProcessFailedResult, IEnumerable <ISeriesMapping> >(_noMappingResult));
        }
        public static ProcessFailedResult Append(ProcessFailedResult a, ProcessFailedResult b)
        {
            return(new ProcessFailedResult(a.SourceName, a.MediaItemName, a.MediaItemType, $@"{a.Reason}
{b.Reason}"));
        }