public void Should_AddTransactionValue() { FinancialDay day = Tester.GetToday(); decimal income = 500; day.AddTransaction(new MockTransaction() { Value = income }.Object); Assert.AreEqual(income, day.EndingBalance); }
public void Should_SubtractNegativeTransactionValue() { FinancialDay day = Tester.GetToday(); decimal expense = -500; day.AddTransaction(new MockTransaction() { Value = expense }.Object); Assert.AreEqual(expense, day.EndingBalance); }
public void Should_AddBalance_To_StartOfDayStatement() { FinancialDay day = Tester.GetToday(); decimal balance = 1000; day.AddStatement(new Statement(balance, AddWhen.StartOfDay)); decimal income = 500; day.AddTransaction(new MockTransaction() { Value = income }.Object); Assert.AreEqual(balance + income, day.EndingBalance); }
public void Should_EndWithStatementBalance_Over_Transactions_When_EndOfDay() { FinancialDay day = Tester.GetToday(); decimal balance = 1000; day.AddStatement(new Statement(balance, AddWhen.EndOfDay)); decimal income = 500; day.AddTransaction(new MockTransaction() { Value = income }.Object); Assert.AreEqual(balance, day.EndingBalance); }
public void Should_AddTransactions_To_PreviousDays_EndingBalance() { FinancialDay day = Tester.GetToday(); decimal balance = 2000; day.PreviousDay = new MockBalance(null, balance) { HasStatementOnLeft = true }.Object; Assert.AreEqual(balance, day.StartingBalance); decimal income = 500; day.AddTransaction(new MockTransaction() { Value = income }.Object); Assert.AreEqual(balance + income, day.EndingBalance); }