/// <summary> /// Initialize the <see cref="DresdenPublicTransportLinesCollector"/> /// </summary> public DresdenTests() { var httpClientFactory = new Mock <IHttpClientFactory>(); httpClientFactory.Setup(x => x.CreateClient(string.Empty)).Returns(new HttpClient()); _publicTransportLinesCollector = new DresdenPublicTransportLinesCollector(httpClientFactory.Object); }
public CacheAdapter(ILogger <CacheAdapter> logger, IDatabaseAdapter databaseAdapter, IPublicTransportLinesCollector publicTransportLinesCollector) { _logger = logger; _databaseAdapter = databaseAdapter; _publicTransportLinesCollector = publicTransportLinesCollector; _existsStopPoints = new ConcurrentDictionary <string, bool>(); _existsTrips = new ConcurrentDictionary <string, bool>(); _stopPointCache = new ConcurrentDictionary <string, CachedStopPoint>(); _tripCache = new ConcurrentDictionary <string, CachedTrip>(); _linesCache = Array.Empty <PublicTransportLine>(); LoadCacheFromStorage().Wait(); }