Ejemplo n.º 1
0
        public async Task MapEpisodeAsync_NoTvDbSeriesId_ReturnsNone()
        {
            this.seriesMapping.Ids.Returns(new SeriesIds(12, Option <int> .None, Option <int> .None, Option <int> .None));

            var defaultSeasonEpisodeMapper = new DefaultSeasonEpisodeMapper(this.tvDbClient, this.logManager);

            var result = await defaultSeasonEpisodeMapper.MapEpisodeAsync(10, this.seriesMapping);

            result.IsNone.Should().BeTrue();
        }
        public async Task MapEpisodeAsync_AbsoluteDefaultTvDbSeason_NoEpisodeData_ReturnsNone()
        {
            _seriesMapping.Ids.Returns(new SeriesIds(12, 33, Option <int> .None, Option <int> .None));
            _seriesMapping.DefaultTvDbSeason.Returns(new AbsoluteTvDbSeason());

            var defaultSeasonEpisodeMapper = new DefaultSeasonEpisodeMapper(_tvDbClient, _logManager);

            var result = await defaultSeasonEpisodeMapper.MapEpisodeAsync(10, _seriesMapping);

            result.IsNone.Should().BeTrue();
        }
Ejemplo n.º 3
0
        public async Task MapEpisodeAsync_DefaultTvDbSeason_NoEpisodeData_ReturnsNone()
        {
            this.seriesMapping.Ids.Returns(new SeriesIds(12, 33, Option <int> .None, Option <int> .None));
            this.seriesMapping.DefaultTvDbSeason.Returns(new TvDbSeason(54));
            this.seriesMapping.DefaultTvDbEpisodeIndexOffset.Returns(7);

            var defaultSeasonEpisodeMapper = new DefaultSeasonEpisodeMapper(this.tvDbClient, this.logManager);

            var result = await defaultSeasonEpisodeMapper.MapEpisodeAsync(10, this.seriesMapping);

            result.IsNone.Should().BeTrue();
        }
Ejemplo n.º 4
0
        public async Task MapEpisodeAsync_AbsoluteDefaultTvDbSeason_MapsOnAbsoluteEpisodeIndex()
        {
            this.seriesMapping.Ids.Returns(new SeriesIds(12, 33, Option <int> .None, Option <int> .None));
            this.seriesMapping.DefaultTvDbSeason.Returns(new AbsoluteTvDbSeason());

            var tvDbEpisodeData = TvDbTestData.Episode(3);

            this.tvDbClient.GetEpisodeAsync(33, 10).Returns(tvDbEpisodeData);

            var defaultSeasonEpisodeMapper = new DefaultSeasonEpisodeMapper(this.tvDbClient, this.logManager);

            var result = await defaultSeasonEpisodeMapper.MapEpisodeAsync(10, this.seriesMapping);

            await this.tvDbClient.Received(1).GetEpisodeAsync(33, 10);

            result.ValueUnsafe().Should().Be(tvDbEpisodeData);
        }
        public async Task MapEpisodeAsync_DefaultTvDbSeason_MapsOnSeasonAndEpisodeIndex()
        {
            _seriesMapping.Ids.Returns(new SeriesIds(12, 33, Option <int> .None, Option <int> .None));
            _seriesMapping.DefaultTvDbSeason.Returns(new TvDbSeason(54));
            _seriesMapping.DefaultTvDbEpisodeIndexOffset.Returns(7);

            var tvDbEpisodeData = TvDbTestData.Episode(3);

            _tvDbClient.GetEpisodeAsync(33, 54, 17).Returns(tvDbEpisodeData);

            var defaultSeasonEpisodeMapper = new DefaultSeasonEpisodeMapper(_tvDbClient, _logManager);

            var result = await defaultSeasonEpisodeMapper.MapEpisodeAsync(10, _seriesMapping);

            await _tvDbClient.Received(1).GetEpisodeAsync(33, 54, 17);

            result.ValueUnsafe().Should().Be(tvDbEpisodeData);
        }