public HistoricalPriceRepositoryTests() { _repo = new HistoricalPriceRepository(); // first clear out the table var deleted = _repo.DeleteAll().Result; // then add some data for testing datas.Add( new HistoricalPrice { Id = 0, CurrencyId = 1, Exchange = Business.Entities.Exchange.Binance, Pair = "BTCUSDT", Price = 4210.00M, Snapshot = DateTime.UtcNow.AddHours(-4), }); datas.Add( new HistoricalPrice { Id = 0, CurrencyId = 1, Exchange = Business.Entities.Exchange.Binance, Pair = "BTCUSDT", Price = 4100.00M, Snapshot = DateTime.UtcNow.AddHours(-3), }); datas.Add( new HistoricalPrice { Id = 0, CurrencyId = 1, Exchange = Business.Entities.Exchange.Binance, Pair = "BTCUSDT", Price = 4050.00M, Snapshot = DateTime.UtcNow.AddHours(-2), }); datas.Add( new HistoricalPrice { Id = 0, CurrencyId = 1, Exchange = Business.Entities.Exchange.Binance, Pair = "BTCUSDT", Price = 3950.00M, Snapshot = DateTime.UtcNow.AddHours(-1), }); datas.Add( new HistoricalPrice { Id = 0, CurrencyId = 1, Exchange = Business.Entities.Exchange.Binance, Pair = "BTCUSDT", Price = 3850.00M, Snapshot = DateTime.UtcNow, }); var addedEntites = _repo.AddAll(datas).Result; }
public HistoricalPriceBuilder(IExchangeHubBuilder exchangeHubBuilder, IHistoricalPriceRepository repo) { this._hubBldr = exchangeHubBuilder; this._hpRepo = repo; }
public ProductHandler(IHistoricalPriceRepository historicalPriceRepository, ILogger <ProductHandler> logger) { _historicalPriceRepository = historicalPriceRepository; _logger = logger; }