Ejemplo n.º 1
0
        public ArticleFetchBackgroundService(INewsClient newsClient, IServiceProvider serviceProvider, ILogger <ArticleFetchBackgroundService> logger, IConfiguration configuration)
        {
            _client   = newsClient;
            _provider = serviceProvider;
            _logger   = logger;

            SleepingPeriod = TimeSpan.FromMinutes(double.Parse(configuration.GetSection("ArticleFetchService:SleepingPeriodMinutes").Value));
        }
Ejemplo n.º 2
0
 public NewsController(ILogger <NewsController> logger)
 {
     _logger     = logger;
     _newsClient = RestService.For <INewsClient>("http://newsapi.org/v2/");
 }
Ejemplo n.º 3
0
 public void TestInitialize()
 {
     scope   = container.BeginLifetimeScope();
     client  = scope.Resolve <INewsClient>();
     request = scope.Resolve <INewsRequest>();
 }
Ejemplo n.º 4
0
 public NewsService(INewsClient newsClient)
 {
     _newsClient = newsClient;
 }
Ejemplo n.º 5
0
        public ClientTests()
        {
            string apiKey = Environment.GetEnvironmentVariable("NEWS_API_KEY");

            _newsClient = new NewsClient(apiKey);
        }