public void CanCountExpenses() { var db = new LittleDB("newYorkTryp"); var newyorkExpenses = new Tryp(db); var food = new Expense(20.3m, "Food", DateTime.Today); var taxi = new Expense(3.2m, "Taxi", DateTime.Today); newyorkExpenses.AddExpense(food); newyorkExpenses.AddExpense(taxi); newyorkExpenses.GetTotalExpenses().Should().Be(23.5m); }
public void CanAddExpensesAndRecoverThem() { var db = new LittleDB("newYorkTryp"); var newyorkExpenses = new Tryp(db); var food = new Expense(20.3m, "Food", DateTime.Today); newyorkExpenses.AddExpense(food); var expenses = newyorkExpenses.GetExpenses(); expenses.Count.Should().Be(1); expenses[0].Amount.Should().Be(20.3m); var taxiExpense = new Expense(5, "Taxi", DateTime.Today); newyorkExpenses.AddExpense(taxiExpense); var actualizedExpenses = newyorkExpenses.GetExpenses(); actualizedExpenses.Count.Should().Be(2); actualizedExpenses[1].Description.Should().Be("Taxi"); }