public async Task VisitsController_Update_Failed_Test() { var visitRepository = new Data.Repositories.Fakes.StubIVisitRepository(); var employeeRepository = new Data.Repositories.Fakes.StubIEmployeeRepository(); var target = new VisitsController(visitRepository, new SecurityHelper(), employeeRepository); await target.Update(null); }
public async Task VisitsController_Update_Test() { bool called = false; var visitRepository = new Data.Repositories.Fakes.StubIVisitRepository(); var employeeRepository = new Data.Repositories.Fakes.StubIEmployeeRepository(); var visit = new Visit() { VisitId = 1, }; visitRepository.UpdateAsyncVisit = (visitParam) => { Assert.IsTrue(visitParam.VisitId == visit.VisitId); called = true; return(Task.FromResult(string.Empty)); }; var target = new VisitsController(visitRepository, new SecurityHelper(), employeeRepository); await target.Update(visit); Assert.IsTrue(called); }