public void Reconcile_ShouldNotCreateTasksForUserTransfersOfBudgetedAmounts_GivenTestData5AndPaymentFromDifferentAccount() { // Modify a InsHome payment transaction, originally coming out of the Savings account where the ledger is stored, to the Cheque account. this.testDataStatement = StatementModelTestData.TestData5(); var insHomePayment = this.testDataStatement.AllTransactions.Single(t => t.BudgetBucket == StatementModelTestData.InsHomeBucket && t.Amount == -1000M); insHomePayment.Account = StatementModelTestData.ChequeAccount; ActOnTestData5(this.testDataStatement); OutputToDoList(); // Given the test data 5 set, there should only be one transfer task. Assert.AreEqual(2, this.testDataToDoList.OfType <TransferTask>().Count()); }
public void Reconcile_ShouldAutoMatchTransactionsAndLinkIdToStatementTransaction_GivenTestData5() { // The automatched credit ledger transaction from last month should be linked to the statement transaction. this.testDataStatement = StatementModelTestData.TestData5(); List <Transaction> statementTransactions = this.testDataStatement.AllTransactions.Where(t => t.Reference1 == "agkT9kC").ToList(); Debug.Assert(statementTransactions.Count() == 2); ActOnTestData5(this.testDataStatement); var previousMonthLine = this.subject.Reconciliations.Single(line => line.Date == new DateTime(2013, 08, 15)).Entries.Single(e => e.LedgerBucket.BudgetBucket == StatementModelTestData.InsHomeBucket); var previousLedgerTxn = previousMonthLine.Transactions.OfType <BudgetCreditLedgerTransaction>().Single(); // Assert last month's ledger transaction has been linked to the credit 16/8/13 Assert.AreEqual(statementTransactions.Single(t => t.Amount > 0).Id, previousLedgerTxn.Id); }
private void ActOnTestData5(StatementModel statementModelTestData = null) { this.subject = LedgerBookTestData.TestData5(); this.testDataBudget = BudgetModelTestData.CreateTestData5(); this.testDataStatement = statementModelTestData ?? StatementModelTestData.TestData5(); Console.WriteLine("********************** BEFORE RUNNING RECONCILIATION *******************************"); this.testDataStatement.Output(ReconcileDate.AddMonths(-1)); this.subject.Output(true); var result = Act(bankBalances: new[] { new BankBalance(StatementModelTestData.ChequeAccount, 1850.5M), new BankBalance(StatementModelTestData.SavingsAccount, 1200M) }); this.testDataToDoList = result.Tasks.ToList(); Console.WriteLine(); Console.WriteLine("********************** AFTER RUNNING RECONCILIATION *******************************"); this.subject.Output(true); }
private void ActOnTestData5(StatementModel statementModelTestData = null, bool ignoreWarnings = false) { this.testDataLedgerBook = LedgerBookTestData.TestData5(() => new LedgerBookTestHarness(new Mock <IReconciliationBuilder>().Object)); this.testDataBudgets = new BudgetCollection(new[] { BudgetModelTestData.CreateTestData5() }); this.testDataBudgetContext = new BudgetCurrencyContext(this.testDataBudgets, this.testDataBudgets.CurrentActiveBudget); this.testDataStatement = statementModelTestData ?? StatementModelTestData.TestData5(); Console.WriteLine("********************** BEFORE RUNNING RECONCILIATION *******************************"); this.testDataStatement.Output(ReconcileDate.AddMonths(-1)); this.testDataLedgerBook.Output(true); Act(bankBalances: new[] { new BankBalance(StatementModelTestData.ChequeAccount, 1850.5M), new BankBalance(StatementModelTestData.SavingsAccount, 1200M) }, ignoreWarnings: ignoreWarnings); Console.WriteLine(); Console.WriteLine("********************** AFTER RUNNING RECONCILIATION *******************************"); this.testDataLedgerBook.Output(true); }