public async Task<ActionResult> DynamicTimes() { var transportTimesModel = new TransportTimesModel(db, User.Identity); var myTransportTimes = await transportTimesModel.MyTransportTimes(); return View(myTransportTimes); }
public void TestMergedList() { AppDomain.CurrentDomain.SetData("DataDirectory", Directory.GetCurrentDirectory()); var dbContext = new GoFastDbContext(); dbContext.Database.Initialize(false); var model = new TransportTimesModel(dbContext, null); var task = model.MyTransportTimes(); Assert.IsTrue(task.Wait(4000), "timed out waiting on external service"); foreach (var journey in task.Result) { Console.WriteLine(journey.Key); foreach (var time in journey.Value) Console.WriteLine($"{time.Service} to {time.Destination}: {time.DueRelative} ({time.DueAbsolute})"); } }