public static LedgerBook TestData5(Func<LedgerBook> ctor = null)
{
LedgerBook book;
if (ctor != null)
{
book = ctor();
}
else
{
book = new LedgerBook(new ReconciliationBuilder(new FakeLogger()));
}
book.Name = "Test Data 5 Book";
book.Modified = new DateTime(2013, 12, 16);
book.StorageKey = "C:\\Folder\\book5.xml";
var list = new List<LedgerEntryLine>
{
CreateLine(
new DateTime(2013, 06, 15),
new[] { new BankBalance(ChequeAccount, 2800), new BankBalance(SavingsAccount, 300) },
"Lorem ipsum")
.SetEntriesForTesting(
new List<LedgerEntry>
{
CreateLedgerEntry(HouseInsLedgerSavingsAccount).SetTransactionsForTesting(
new List<LedgerTransaction>
{
new BudgetCreditLedgerTransaction { Amount = 300M, Narrative = "Budgeted amount", AutoMatchingReference = "IbEMWG7" }
}),
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" }
})
})
};
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);
LedgerEntry previousInsEntry = list.Last().Entries.Single(e => e.LedgerBucket.BudgetBucket.Code == TestDataConstants.InsuranceHomeBucketCode);
list.Add(
CreateLine(
new DateTime(2013, 07, 15),
new[] { new BankBalance(ChequeAccount, 4000), new BankBalance(SavingsAccount, 600) },
"dolor amet set").SetEntriesForTesting(
new List<LedgerEntry>
{
CreateLedgerEntry(HouseInsLedgerSavingsAccount, previousInsEntry.Balance).SetTransactionsForTesting(
new List<LedgerTransaction>
{
new BudgetCreditLedgerTransaction { Amount = 300M, Narrative = "Budgeted amount", AutoMatchingReference = "9+1R06x" }
}),
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);
previousInsEntry = list.Last().Entries.Single(e => e.LedgerBucket.BudgetBucket.Code == TestDataConstants.InsuranceHomeBucketCode);
LedgerEntryLine line = CreateLine(
new DateTime(2013, 08, 15),
new[] { new BankBalance(ChequeAccount, 3050), new BankBalance(SavingsAccount, 1000) },
"The quick brown fox jumped over the lazy dog").SetEntriesForTesting(
new List<LedgerEntry>
{
CreateLedgerEntry(HouseInsLedgerSavingsAccount, previousInsEntry.Balance).SetTransactionsForTesting(
new List<LedgerTransaction>
{
new BudgetCreditLedgerTransaction { Amount = 300M, Narrative = "Budgeted amount", AutoMatchingReference = "agkT9kC" }
}),
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" }
})
});
line.BalanceAdjustment(-550, "Credit card payment yet to go out.", ChequeAccount);
list.Add(line);
book.SetReconciliations(list);
Finalise(book);
return book;
}