public void AddExpenseToGroup(Expense expense, int groupId)
        {
            Group group = GetGroup(groupId);
            int expenseCount = group.ExpenseCount;
            expense.Id = expenseCount + 1;

            group.AddExpense(expense);
        }
        public void Execute()
        {
            IRepository repo = new InMemoryRepository();
            Validate(repo);

            Expense expense = new Expense(description, amount, owner);
            repo.AddExpenseToGroup(expense, groupId);
        }
Example #3
0
 public void AddExpense(Expense expense)
 {
     expenses.Add(expense);
 }