Beispiel #1
0
        public async Task ExpensesController_GetTeamCount_Test()
        {
            bool called                        = false;
            var  expenseRepository             = new Data.Repositories.Fakes.StubIExpenseRepository();
            var  notificationChannelRepository = new Data.Repositories.Fakes.StubINotificationChannelRepository();
            var  notificationService           = new Services.Fakes.StubINotificationService();

            expenseRepository.GetTeamCountAsyncStringInt32 = (id, status) =>
            {
                called = true;
                return(Task.FromResult(10));
            };

            var target = new ExpensesController(expenseRepository, new SecurityHelper(), notificationChannelRepository, notificationService);
            var result = await target.GetTeamCount(0);

            Assert.IsTrue(result == 10);
            Assert.IsTrue(called);
        }