Ejemplo n.º 1
0
        public async Task VisitsController_GetContFromDate_Test()
        {
            bool called             = false;
            var  visitRepository    = new Data.Repositories.Fakes.StubIVisitRepository();
            var  employeeRepository = new Data.Repositories.Fakes.StubIEmployeeRepository();

            visitRepository.GetCountFromDateAsyncStringDateTime = (filter, datetime) =>
            {
                Assert.IsNotNull(datetime);
                called = true;
                return(Task.FromResult(20));
            };

            var target = new VisitsController(visitRepository, new SecurityHelper(), employeeRepository);
            var result = await target.GetCountFromDate(string.Empty, DateTime.Today);

            Assert.IsNotNull(result);
            Assert.IsTrue(called);
        }