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)); }
public NewsController(ILogger <NewsController> logger) { _logger = logger; _newsClient = RestService.For <INewsClient>("http://newsapi.org/v2/"); }
public void TestInitialize() { scope = container.BeginLifetimeScope(); client = scope.Resolve <INewsClient>(); request = scope.Resolve <INewsRequest>(); }
public NewsService(INewsClient newsClient) { _newsClient = newsClient; }
public ClientTests() { string apiKey = Environment.GetEnvironmentVariable("NEWS_API_KEY"); _newsClient = new NewsClient(apiKey); }