public void AddandGet() { _repo.UpSertSchedule(new Schedule { Id = 1, Time = DateTime.Now }); var result = _repo.GetAllSchedule(); Assert.AreEqual(1, result.Count); Assert.AreEqual(1, result.First().Id); }
public async Task <ActionResult> AddSchedule(ScheduleViewModel model) { if (ModelState.IsValid) { var schedule = new Schedule(model); var repo = new EplRepo(); repo.UpSertSchedule(schedule); return(RedirectToAction("Index", "Home")); } return(RedirectToAction("About", "Home")); }