public void ShouldPassCurrentTimeAsReportTime() { var currentTime = new DateTime(2019, 09, 22, 10, 48, 00); var report = _reportBuilder.PrepareReport(currentTime, Array.Empty <Trade>()); Assert.AreEqual(currentTime, report.ReportTime); }
public async Task ExecuteAsync() { // Get current time (report extraction time) var currentTime = _timeProvider.GetCurrentTime(); // Request trades from trading platform asynchronously (to not block scheduler thread) var trades = await _tradingService.GetTradesAsync(currentTime); // Prepare report model from received trades (in separate thread) var tradeReport = _reportBuilder.PrepareReport(currentTime, trades); // Write report to csv file await _reportService.WriteReportAsync(tradeReport); }