Esempio n. 1
0
        public ActionResult Details(int GroupId)
        {
            var expenseLineItems = _expenseItemService.FindByIncludinguserDetails(GroupId).ToList().Select(GetExpeneLineItem).ToList();

            _calculatorfactory = new ExpenseCalculatorFactory(expenseLineItems);
            var calculator = _calculatorfactory.CreateExpenseCalculator();

            var VM = new ExpenseSummaryVM
            {
                GroupId = GroupId,
                AmountOwedByIndividuals          = calculator.CalculateAmountOwedByIndividuals(),
                AverageExpense                   = calculator.AverageExpense,
                ToalExpense                      = calculator.ToalExpense,
                NumberOfPeople                   = calculator.NumberOfPeople,
                AmountCurrentlyPaidByIndividuals = AmountCurrentlyPaidByInduviduals(calculator.TotalExpensePaidByIndividuals)
            };

            return(View(VM));
        }
Esempio n. 2
0
        public void ThatCreateMethodWillCreateInstanceOfExpenseCalculator()
        {
            var application = _expenseCalculatorFactory.CreateExpenseCalculator();

            Assert.That(application, Is.InstanceOf <IExpenseCalculator>());
        }