コード例 #1
0
 /// <inheritdoc />
 public SyncTvMazeDbCommandHandler(
     ITvMazeService tvMazeService,
     IShowsRepository showsRepository,
     IPersonsRepository personsRepository)
 {
     _tvMazeService     = tvMazeService ?? throw new ArgumentNullException(nameof(tvMazeService));
     _showsRepository   = showsRepository ?? throw new ArgumentNullException(nameof(showsRepository));
     _personsRepository = personsRepository ?? throw new ArgumentNullException(nameof(personsRepository));
 }
コード例 #2
0
        public SearchTvShowQueryHandlerTests()
        {
            _show1 = CreateShow1();
            _show2 = CreateShow2();

            _tvMazeService = Substitute.For <ITvMazeService>();
            _subscriptionQueryDataSource = Substitute.For <ISubscriptionQueryDataSource>();
            _handler = new SearchTvShowQueryHandler(_tvMazeService, _subscriptionQueryDataSource);
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScrapeController" /> class.
 /// </summary>
 /// <param name="showService">The show service.</param>
 /// <param name="tvMazeService">The tv maze service.</param>
 /// <param name="logger">The log service.</param>
 public ScrapeController(
     IShowService showService,
     ITvMazeService tvMazeService,
     ILogger <ScrapeController> logger)
 {
     this.showService   = showService;
     this.tvMazeService = tvMazeService;
     this.logger        = logger;
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScraperWorker" /> class.
 /// </summary>
 /// <param name="showService">The show service.</param>
 /// <param name="tvMazeService">The tv maze service.</param>
 /// <param name="hubContext">The hub context.</param>
 /// <param name="logger">The logger.</param>
 public ScraperWorker(
     IShowService showService,
     ITvMazeService tvMazeService,
     IHubContext <ScraperHub> hubContext,
     ILogger <ScraperWorker> logger)
 {
     this.showService   = showService;
     this.tvMazeService = tvMazeService;
     this.hubContext    = hubContext;
     this.logger        = logger;
 }
コード例 #5
0
        public UpdateEpisodesServiceTests()
        {
            _subscription1 = CreateSubscription(1, 555, "The Stuff", DateTime.Now.AddDays(-2).Date);
            _subscription2 = CreateSubscription(2, 666, "The Stuff 2", DateTime.Now.AddDays(-3).Date);

            _regularEpisode1 = CreateRegularEpisode(2, 3, "Stuff happened", DateTime.Now.AddDays(2).Date);
            _regularEpisode2 = CreateRegularEpisode(2, 4, "Stuff didn't happen", DateTime.Now.AddDays(-1).Date);
            _regularEpisode3 = CreateRegularEpisode(1, 1, "Stuff 2 stuff", DateTime.Now.AddDays(-1).Date);
            _regularEpisode4 = CreateRegularEpisode(1, 2, "No stuff", DateTime.Now.AddDays(-3).Date);
            _regularEpisode5 = CreateRegularEpisode(1, 3, "Oh dear", DateTime.Now.AddDays(-4).Date);

            _specialEpisode1 = CreateSpecialEpisode(2, "Special stuff", DateTime.Now.AddDays(1).Date);
            _specialEpisode2 = CreateSpecialEpisode(1, "Stuff 2 Special", DateTime.Now.AddDays(-2).Date);
            _specialEpisode3 = CreateSpecialEpisode(1, "Stuff 2 Special 2", DateTime.Now.AddDays(-4).Date);

            _episodeCommandDataSource = Substitute.For <IEpisodeCommandDataSource>();
            _tvMazeService            = Substitute.For <ITvMazeService>();
            _service = new UpdateEpisodesService(_episodeCommandDataSource, _tvMazeService);
        }
コード例 #6
0
ファイル: TvMazeController.cs プロジェクト: cboorsma/TvMaze
 public TvMazeController(ITvMazeService tvMazeServiceService)
 {
     _tvMazeServiceService = tvMazeServiceService;
 }
コード例 #7
0
        public void Initialize()
        {
            var jsonJsonApiDataReader = new JsonApiDataReader(new Uri("http://api.tvmaze.com"));

            _tvMazeService = new TvMazeService(jsonJsonApiDataReader, GetLogger());
        }
コード例 #8
0
 public TvMazeScraperTimerEventTrigger(ITvMazeService tvMazeService, IMediator mediator)
 {
     _tvMazeService = tvMazeService;
     _mediator      = mediator;
 }
コード例 #9
0
 public UpdateEpisodesService(IEpisodeCommandDataSource episodeCommandDataSource, ITvMazeService tvMazeService)
 {
     _episodeCommandDataSource = episodeCommandDataSource;
     _tvMazeService            = tvMazeService;
 }
コード例 #10
0
 public ScrapeTvMazeCommandHandler(ITvMazeService tvMazeService, ICommandHandler <SaveCastCommand> saveCastCommandHandler)
 {
     this.tvMazeService          = tvMazeService ?? throw new ArgumentNullException(nameof(tvMazeService));
     this.saveCastCommandHandler = saveCastCommandHandler ?? throw new ArgumentNullException(nameof(saveCastCommandHandler));
 }
コード例 #11
0
 public TvMazeApiScraperService(IBookmarkDbRepository bookmarkDbRepository, ITvShowDbRepository tvShowDbRepository, ITvMazeService tvMazeService)
 {
     _bookmarkDbRepository = bookmarkDbRepository;
     _tvShowDbRepository   = tvShowDbRepository;
     _tvMazeService        = tvMazeService;
 }
コード例 #12
0
 public SearchTvShowQueryHandler(ITvMazeService tvMazeService,
                                 ISubscriptionQueryDataSource subscriptionQueryDataSource)
 {
     _tvMazeService = tvMazeService;
     _subscriptionQueryDataSource = subscriptionQueryDataSource;
 }