SetReconciliations() приватный Метод

private SetReconciliations ( List lines ) : void
lines List
Результат void
Пример #1
0
        public LedgerBook Build()
        {
            var book = new LedgerBook(new ReconciliationBuilder(new FakeLogger()))
            {
                Name = Name,
                Modified = Modified,
                StorageKey = StorageKey
            };

            book.SetReconciliations(this.reconciliations);
            if (book.Reconciliations.None())
            {
                this.ledgerBuckets.ForEach(l => book.AddLedger(l));
            }

            LedgerBookTestData.Finalise(book, this.lockWhenFinished);
            return book;
        }
Пример #2
0
        /// <summary>
        ///     A Test LedgerBook with data populated for June, July and August 2013.  Also includes some debit transactions.
        /// </summary>
        public static LedgerBook TestData1()
        {
            var book = new LedgerBook(new ReconciliationBuilder(new FakeLogger()))
            {
                Name = "Test Data 1 Book",
                Modified = new DateTime(2013, 12, 16),
                StorageKey = "C:\\Folder\\book1.xml"
            };

            LedgerEntryLine line = CreateLine(new DateTime(2013, 06, 15), new[] { new BankBalance(StatementModelTestData.ChequeAccount, 2500) }, "Lorem ipsum");
            SetEntriesForTesting(
                line,
                new List<LedgerEntry>
                {
                    CreateLedgerEntry(HairLedger).SetTransactionsForTesting(
                        new List<LedgerTransaction>
                        {
                            new BudgetCreditLedgerTransaction { Amount = 55M, Narrative = "Budgeted amount" },
                            new CreditLedgerTransaction { Amount = -45M, Narrative = "Hair cut" }
                        }),
                    CreateLedgerEntry(PowerLedger).SetTransactionsForTesting(
                        new List<LedgerTransaction>
                        {
                            new BudgetCreditLedgerTransaction { Amount = 140M, Narrative = "Budgeted amount" },
                            new CreditLedgerTransaction { Amount = -123.56M, Narrative = "Power bill" }
                        }),
                    CreateLedgerEntry(PhoneLedger).SetTransactionsForTesting(
                        new List<LedgerTransaction>
                        {
                            new BudgetCreditLedgerTransaction { Amount = 95M, Narrative = "Budgeted amount" },
                            new CreditLedgerTransaction { Amount = -86.43M, Narrative = "Pay phones" }
                        })
                });


            var list = new List<LedgerEntryLine> { line };

            LedgerEntry previousHairEntry = list.Last().Entries.Single(e => e.LedgerBucket.BudgetBucket.Code == TestDataConstants.HairBucketCode);
            LedgerEntry previousPowerEntry = list.Last().Entries.Single(e => e.LedgerBucket.BudgetBucket.Code == TestDataConstants.PowerBucketCode);
            LedgerEntry previousPhoneEntry = list.Last().Entries.Single(e => e.LedgerBucket.BudgetBucket.Code == TestDataConstants.PhoneBucketCode);

            list.Add(
                CreateLine(new DateTime(2013, 07, 15), new[] { new BankBalance(StatementModelTestData.ChequeAccount, 3700) }, "dolor amet set").SetEntriesForTesting(
                    new List<LedgerEntry>
                    {
                        CreateLedgerEntry(HairLedger, previousHairEntry.Balance).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new BudgetCreditLedgerTransaction { Amount = 55M, Narrative = "Budgeted amount" }
                            }),
                        CreateLedgerEntry(PowerLedger, previousPowerEntry.Balance).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new BudgetCreditLedgerTransaction { Amount = 140M, Narrative = "Budgeted amount" },
                                new CreditLedgerTransaction { Amount = -145.56M, Narrative = "Power bill" }
                            }),
                        CreateLedgerEntry(PhoneLedger, previousPhoneEntry.Balance).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new BudgetCreditLedgerTransaction { Amount = 95M, Narrative = "Budgeted amount" },
                                new CreditLedgerTransaction { Amount = -66.43M, Narrative = "Pay phones" }
                            })
                    }));

            previousHairEntry = list.Last().Entries.Single(e => e.LedgerBucket.BudgetBucket.Code == TestDataConstants.HairBucketCode);
            previousPowerEntry = list.Last().Entries.Single(e => e.LedgerBucket.BudgetBucket.Code == TestDataConstants.PowerBucketCode);
            previousPhoneEntry = list.Last().Entries.Single(e => e.LedgerBucket.BudgetBucket.Code == TestDataConstants.PhoneBucketCode);

            list.Add(
                CreateLine(
                    new DateTime(2013, 08, 15),
                    new[] { new BankBalance(StatementModelTestData.ChequeAccount, 2950) },
                    "The quick brown fox jumped over the lazy dog").SetEntriesForTesting(
                        new List<LedgerEntry>
                        {
                            CreateLedgerEntry(HairLedger, previousHairEntry.Balance).SetTransactionsForTesting(
                                new List<LedgerTransaction>
                                {
                                    new BudgetCreditLedgerTransaction { Amount = 55M, Narrative = "Budgeted amount" }
                                }),
                            CreateLedgerEntry(PowerLedger, previousPowerEntry.Balance).SetTransactionsForTesting(
                                new List<LedgerTransaction>
                                {
                                    new BudgetCreditLedgerTransaction { Amount = 140M, Narrative = "Budgeted amount" },
                                    new CreditLedgerTransaction { Amount = -98.56M, Narrative = "Power bill" }
                                }),
                            CreateLedgerEntry(PhoneLedger, previousPhoneEntry.Balance).SetTransactionsForTesting(
                                new List<LedgerTransaction>
                                {
                                    new BudgetCreditLedgerTransaction { Amount = 95M, Narrative = "Budgeted amount" },
                                    new CreditLedgerTransaction { Amount = -67.43M, Narrative = "Pay phones" }
                                })
                        }));

            book.SetReconciliations(list);

            Finalise(book);
            return book;
        }
Пример #3
0
        /// <summary>
        ///     A Test LedgerBook with data populated for November 2013, last date 15/11/13.
        ///     This was used to seed the actual ledger I use for the first time.
        /// </summary>
        public static LedgerBook TestData3()
        {
            var book = new LedgerBook(new ReconciliationBuilder(new FakeLogger()))
            {
                Name = "Smith Budget 2014",
                Modified = new DateTime(2013, 12, 22),
                StorageKey = @"C:\Foo\SmithLedger2014.xml"
            };

            var list = new List<LedgerEntryLine>
            {
                CreateLine(new DateTime(2013, 11, 15), new[] { new BankBalance(StatementModelTestData.ChequeAccount, 10738) }, "Opening entries").SetEntriesForTesting(
                    new List
                        <LedgerEntry>
                    {
                        CreateLedgerEntry(RatesLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 573M, Narrative = "Opening ledger balance" }
                            }),
                        CreateLedgerEntry(PowerLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 200M, Narrative = "Opening ledger balance" }
                            }),
                        CreateLedgerEntry(PhoneLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 215M, Narrative = "Opening ledger balance" }
                            }),
                        CreateLedgerEntry(WaterLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 50M, Narrative = "Opening ledger balance" }
                            }),
                        CreateLedgerEntry(HouseInsLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 100M, Narrative = "Opening ledger balance" }
                            }),
                        CreateLedgerEntry(CarInsLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 421M, Narrative = "Opening ledger balance" }
                            }),
                        CreateLedgerEntry(LifeInsLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 1626M, Narrative = "Opening ledger balance" }
                            }),
                        CreateLedgerEntry(CarMtcLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 163M, Narrative = "Opening ledger balance" }
                            }),
                        CreateLedgerEntry(RegoLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 434.73M, Narrative = "Opening ledger balance" }
                            }),
                        CreateLedgerEntry(HairLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 105M, Narrative = "Opening ledger balance" }
                            }),
                        CreateLedgerEntry(ClothesLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 403.56M, Narrative = "Opening ledger balance" }
                            }),
                        CreateLedgerEntry(DocLedger).SetTransactionsForTesting(
                            new List<LedgerTransaction>
                            {
                                new CreditLedgerTransaction { Amount = 292.41M, Narrative = "Opening ledger balance" }
                            })
                    })
            };

            book.SetReconciliations(list);

            Finalise(book);
            return book;
        }