Esempio n. 1
0
        public async Task ExpensesController_GetTeamExpenses_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.GetTeamExpensesAsyncStringInt32PictureTypeInt32Int32 = (id, status, picture, pageSize, pageCount) =>
            {
                called = true;
                return(Task.FromResult(new List <Expense>().AsEnumerable()));
            };

            var target = new ExpensesController(expenseRepository, new SecurityHelper(), notificationChannelRepository, notificationService);
            var result = await target.GetTeamExpenses(0, PictureType.Small, 5, 0);

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