public async Task VisitsController_GetCount_Test() { bool called = false; var visitRepository = new Data.Repositories.Fakes.StubIVisitRepository(); var employeeRepository = new Data.Repositories.Fakes.StubIEmployeeRepository(); visitRepository.GetCountAsyncStringNullableOfDateTimeNullableOfDateTime = (filter, datetime, toDateTime) => { Assert.IsNull(datetime); called = true; return(Task.FromResult(10)); }; var target = new VisitsController(visitRepository, new SecurityHelper(), employeeRepository); var result = await target.GetCount(string.Empty, null, null); Assert.IsNotNull(result); Assert.IsTrue(called); }