Ejemplo n.º 1
0
 public RssSyncJob(IEnumerable<IndexerBase> indexers, DownloadProvider downloadProvider, IndexerProvider indexerProvider,
     MonitoredEpisodeSpecification isMonitoredEpisodeSpecification, AllowedDownloadSpecification allowedDownloadSpecification, UpgradeHistorySpecification upgradeHistorySpecification)
 {
     _indexers = indexers;
     _downloadProvider = downloadProvider;
     _indexerProvider = indexerProvider;
     _isMonitoredEpisodeSpecification = isMonitoredEpisodeSpecification;
     _allowedDownloadSpecification = allowedDownloadSpecification;
     _upgradeHistorySpecification = upgradeHistorySpecification;
 }
Ejemplo n.º 2
0
 public RssSyncJob(DownloadProvider downloadProvider, IndexerProvider indexerProvider,
     MonitoredEpisodeSpecification isMonitoredEpisodeSpecification, AllowedDownloadSpecification allowedDownloadSpecification, 
     UpgradeHistorySpecification upgradeHistorySpecification, ConfigProvider configProvider)
 {
     _downloadProvider = downloadProvider;
     _indexerProvider = indexerProvider;
     _isMonitoredEpisodeSpecification = isMonitoredEpisodeSpecification;
     _allowedDownloadSpecification = allowedDownloadSpecification;
     _upgradeHistorySpecification = upgradeHistorySpecification;
     _configProvider = configProvider;
 }
        public void Setup()
        {
            monitoredEpisodeSpecification = Mocker.Resolve<MonitoredEpisodeSpecification>();

            fakeSeries = Builder<Series>.CreateNew()
                .With(c => c.Monitored = true)
                .Build();

            parseResultMulti = new EpisodeParseResult
            {
                SeriesTitle = "Title",
                Series = fakeSeries,
                EpisodeNumbers = new List<int> { 3, 4 },
                SeasonNumber = 12,
            };

            parseResultSingle = new EpisodeParseResult
            {
                SeriesTitle = "Title",
                Series = fakeSeries,
                EpisodeNumbers = new List<int> { 3 },
                SeasonNumber = 12,
            };

            firstEpisode = new Episode { Ignored = false };
            secondEpisode = new Episode { Ignored = false };

            var singleEpisodeList = new List<Episode> { firstEpisode };
            var doubleEpisodeList = new List<Episode> { firstEpisode, secondEpisode };

            Mocker.GetMock<EpisodeProvider>().Setup(c => c.GetEpisodesByParseResult(parseResultSingle)).Returns(singleEpisodeList);
            Mocker.GetMock<EpisodeProvider>().Setup(c => c.GetEpisodesByParseResult(parseResultMulti)).Returns(doubleEpisodeList);

            Mocker.GetMock<SeriesProvider>().Setup(c => c.FindSeries(parseResultMulti.CleanTitle)).Returns(fakeSeries);
            Mocker.GetMock<SeriesProvider>().Setup(c => c.FindSeries(parseResultSingle.CleanTitle)).Returns(fakeSeries);
        }