public async Task VisitsController_GetUserVisits_Test() { bool called = false; var visitRepository = new Data.Repositories.Fakes.StubIVisitRepository(); var employeeRepository = new Data.Repositories.Fakes.StubIEmployeeRepository(); visitRepository.GetUserVisitsAsyncStringStringPictureTypeInt32Int32 = (identity, filter, picture, pageSize, pageCount) => { called = true; return(Task.FromResult(new List <Visit>().AsEnumerable())); }; var target = new VisitsController(visitRepository, new SecurityHelper(), employeeRepository); var result = await target.GetUserVisits(string.Empty, PictureType.Small, 1, 1, DateTime.UtcNow); Assert.IsNotNull(result); Assert.IsTrue(called); }