Example #1
0
        public void ExpensesController_GetTeamExpensesByMonth_Test()
        {
            bool called                        = false;
            int  expenseType                   = 1;
            var  expenseRepository             = new Data.Repositories.Fakes.StubIExpenseRepository();
            var  notificationChannelRepository = new Data.Repositories.Fakes.StubINotificationChannelRepository();
            var  notificationService           = new Services.Fakes.StubINotificationService();

            expenseRepository.GetTeamExpensesByMonthStringInt32 = (id, type) =>
            {
                Assert.AreEqual(expenseType, type);
                called = true;
                return(new List <ExpenseMonth>());
            };

            var target = new ExpensesController(expenseRepository, new SecurityHelper(), notificationChannelRepository, notificationService);
            var result = target.GetTeamExpensesByMonth(expenseType);

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