Ejemplo n.º 1
0
        public void GetExpenseShouldReturnZeroExpenseAfterConstruction()
        {
            var list = new ExpenseList();

            var result = list.GetExpense(Id);

            Assert.AreEqual(new Money(), result.Value);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }