public StockDataServiceTests() { _stockDataRepository = new Mock <IStockDataRepository>(); var options = new Mock <IOptionsMonitor <CacheOptions> >(); options.Setup(o => o.Get(SingleQuoteCache.CacheName)).Returns(new CacheOptions { CacheExpiryTimeMinutes = 10, CacheItemSize = 1, CacheSize = 100 }); _cache = new SingleQuoteCache(options.Object); _service = new StockDataService(_stockDataRepository.Object, _cache, new QuerySubscriptions(), new Mock <ILogger <StockDataService> >().Object); _singleQuoteData = new SingleQuoteData( symbolId: 1, ticker: "MSFT", high: 1, low: 2, open: 3, previousClose: 4, volume: 5, change: 6, price: 7, changePercent: 0.9m, lastUpdated: DateTime.UtcNow, lastTradingDay: DateTime.UtcNow ); }
public StockDataService(IStockDataRepository stockDataRepository, SingleQuoteCache singleQuoteCache, QuerySubscriptions querySubscriptions, ILogger <StockDataService> logger) { _stockDataRepository = stockDataRepository; _singleQuoteCache = singleQuoteCache; _querySubscriptions = querySubscriptions; _logger = logger; }
public SingleQuoteContext( IStockClient stockClient, SingleQuoteCache queryResultCache, ISymbolRepository symbolRepository, IStockDataService stockDataService, IStockNotificationCenter notificationCenter, SingleQuoteQuery query, ILogger <SingleQuoteContext> logger) { _stockClient = stockClient; _queryResultCache = queryResultCache; _symbolRepository = symbolRepository; _stockDataService = stockDataService; _notificationCenter = notificationCenter; _query = query; _logger = logger; }