示例#1
0
        public void GetExpenseShouldReturnZeroExpenseAfterConstruction()
        {
            var list = new ExpenseList();

            var result = list.GetExpense(Id);

            Assert.AreEqual(new Money(), result.Value);
        }
示例#2
0
        public void GetExpenseShouldReturnExpenseAfterItWasAddedWithAddExpenseUsingSameId()
        {
            var list         = new ExpenseList();
            var expenseValue = new Money(10m);

            list.AddExpense(new Expense(Id, expenseValue));
            var result = list.GetExpense(Id);

            Assert.AreEqual(expenseValue, result.Value);
        }
示例#3
0
        public void AddExpenseShouldIncreaseExpenseAfterItWasAlreadyAdded()
        {
            var list         = new ExpenseList();
            var expenseValue = new Money(10m);

            list.AddExpense(new Expense(Id, expenseValue));
            list.AddExpense(new Expense(Id, expenseValue));
            var updatedExpense = list.GetExpense(Id);

            Assert.AreEqual(new Money(20m), updatedExpense.Value);
        }