Example #1
0
        public void Should_EndWithStatementBalance_When_StartOfDay()
        {
            FinancialDay day     = Tester.GetToday();
            decimal      balance = 1000;

            day.AddStatement(new Statement(balance, AddWhen.StartOfDay));
            Assert.AreEqual(balance, day.EndingBalance);
        }
        public void Should_Statement_If_Statement_Is_EndOfDay()
        {
            FinancialDay day = Tester.GetToday();

            decimal balance = 1000;

            day.AddStatement(new Statement(balance, AddWhen.EndOfDay));

            Assert.AreEqual(balance, day.StartingBalance);
        }
        public void Should_StartWith_StatementBalance_If_PreviousDay_HasNoStatement()
        {
            FinancialDay day = Tester.GetToday();

            day.PreviousDay = new MockBalance(0, 500)
            {
                HasStatementOnLeft = false
            }.Object;

            decimal balance = 1000;

            day.AddStatement(new Statement(balance, AddWhen.EndOfDay));

            Assert.AreEqual(1000, day.StartingBalance);
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }