public void WithAmountMinus50ShouldCreateADebitOf50()
        {
            var subject = new CreditLedgerTransaction();

            LedgerTransaction result = subject.WithAmount(-50);

            Assert.AreEqual(-50M, result.Amount);
        }
        public void WithAmount50ShouldAZeroDebitAmount()
        {
            var subject = new CreditLedgerTransaction();

            LedgerTransaction result = subject.WithAmount(50);

            Assert.AreEqual(0M, result.Debit);
        }
        public void WithAmount50ShouldReturnSameObjectForChaining()
        {
            var subject = new CreditLedgerTransaction();

            LedgerTransaction result = subject.WithAmount(50);

            Assert.AreSame(subject, result);
        }
        public LedgerTransaction CreateLedgerTransaction(LedgerEntryLine reconciliation, LedgerEntry ledgerEntry,
                                                         decimal amount, string narrative)
        {
            if (reconciliation == null)
            {
                throw new ArgumentNullException(nameof(reconciliation));
            }

            if (ledgerEntry == null)
            {
                throw new ArgumentNullException(nameof(ledgerEntry));
            }

            if (narrative == null)
            {
                throw new ArgumentNullException(nameof(narrative));
            }

            LedgerTransaction newTransaction = new CreditLedgerTransaction();
            newTransaction.WithAmount(amount).WithNarrative(narrative);
            newTransaction.Date = reconciliation.Date;
            ledgerEntry.AddTransaction(newTransaction);
            return newTransaction;
        }