public void GenerateSummary() { var gap = new GasAzurePersistor(ConfigurationManager.ConnectionStrings["AzureWebJobsStorage"].ConnectionString); var startDate = new DateTime(2018, 08, 14); var endDate = DateTime.UtcNow; foreach (var d in EachDay(startDate, endDate)) { var l = gap.Get(d); gap.SaveSummary(l).Wait(); var s = gap.GetSummary(d); Console.WriteLine($"OK: {d:d} (E: {s.EthGasPriceStandard} | R: {s.RSKMinGasPrice})"); Assert.AreNotEqual(0, s.BtcVsUsd); Assert.AreNotEqual(0, s.EthGasPriceFast); Assert.AreNotEqual(0, s.EthGasPriceLow); Assert.AreNotEqual(0, s.EthGasPriceStandard); Assert.AreNotEqual(0, s.EthVsUsd); Assert.AreNotEqual(0, s.RSKMinGasPrice); } }
public void WhenSaveAMeasurementThenSaves() { var gap = new GasAzurePersistor(ConfigurationManager.ConnectionStrings["AzureWebJobsStorage"].ConnectionString); const int rsk = 1; var d = DateTime.UtcNow; gap.Save(new GasMeasurement { Moment = d, RSKMinGasPrice = rsk }); var l = gap.Get(d); Assert.AreEqual(rsk, l.Last().RSKMinGasPrice); }
private IEnumerable <GasMeasurement> GetByDateFromStorage(DateTime d) { return(_gasAzurePersistor.Get(d)); }