コード例 #1
0
        public void Prints_a_statement_containing_all_transactions()
        {
            transactionsStore.HasStoredTransactions(
                ATransaction
                .On(ADate)
                .For(1000.00m),
                ATransaction
                .On(ADate)
                .For(-200.00m));

            account.PrintStatement();

            console.HasWroteLinesInOrderOf(
                "DATE | AMOUNT | BALANCE",
                "05/09/2018 | -200.00 | 800.00",
                "05/09/2018 | 1000.00 | 1000.00");
        }
コード例 #2
0
        public void Contains_all_transactions()
        {
            dateProvider.WhenAskedForTodaysDateReturns(FirstTransactionDate)
            .ThenReturns(SecondTransactionDate)
            .ThenReturns(ThirdTransactionDate);

            account.Deposit(1000.00m);
            account.Withdrawal(100.00m);
            account.Deposit(500.00m);

            account.PrintStatement();

            console.HasWroteLinesInOrderOf(
                "DATE | AMOUNT | BALANCE",
                "05/11/2018 | 500.00 | 1400.00",
                "05/10/2018 | -100.00 | 900.00",
                "05/09/2018 | 1000.00 | 1000.00");
        }