Example #1
0
        public async Task ExpensesController_GetTeamMemberSummaryExpenses_Test()
        {
            bool called                        = false;
            int  month                         = 1;
            int  year                          = 2;
            var  expenseRepository             = new Data.Repositories.Fakes.StubIExpenseRepository();
            var  notificationChannelRepository = new Data.Repositories.Fakes.StubINotificationChannelRepository();
            var  notificationService           = new Services.Fakes.StubINotificationService();

            expenseRepository.GetTeamMemberSummaryExpensesAsyncInt32NullableOfInt32Int32 = (id, m, y) =>
            {
                Assert.AreEqual(month, m);
                Assert.AreEqual(year, y);
                called = true;

                return(Task.FromResult(new List <TeamMemberSummary>().AsEnumerable()));
            };

            var target = new ExpensesController(expenseRepository, new SecurityHelper(), notificationChannelRepository, notificationService);
            var result = await target.GetTeamMemberSummaryExpenses(1, year, month);

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