Example #1
0
        public async Task VisitsController_GetUserCount_Test()
        {
            bool called             = false;
            var  visitRepository    = new Data.Repositories.Fakes.StubIVisitRepository();
            var  employeeRepository = new Data.Repositories.Fakes.StubIEmployeeRepository();

            visitRepository.GetUserCountAsyncStringString = (user, filter) =>
            {
                called = true;
                return(Task.FromResult(10));
            };

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

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