public static LedgerBookDto TestData1()
{
var book = new LedgerBookDto
{
Modified = new DateTime(2013, 12, 14),
Name = "Test Budget Ledger Book 1",
StorageKey = "C:\\Folder\\FooBook.xml"
};
var lines = new List<LedgerEntryLineDto>();
LedgerEntryLineDto line1 = AddEntryLineForTestData1(lines, new DateTime(2013, 12, 20));
line1.Entries.AddRange(
new[]
{
new LedgerEntryDto
{
Balance = 0, // because would go into negative
BucketCode = TestDataConstants.RatesBucketCode,
Transactions = new List<LedgerTransactionDto>
{
new LedgerTransactionDto
{
Id = id1,
Amount = 75,
Narrative = "Budgeted Amount",
TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
},
new LedgerTransactionDto
{
Id = id2,
Amount = -195,
Narrative = "Rates payment",
TransactionType = typeof(CreditLedgerTransaction).FullName
}
}
},
new LedgerEntryDto
{
Balance = 21.15M,
BucketCode = TestDataConstants.RegoBucketCode,
Transactions = new List<LedgerTransactionDto>
{
new LedgerTransactionDto
{
Id = id3,
Amount = 21.15M,
Narrative = "Budgeted Amount",
TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
}
}
},
new LedgerEntryDto
{
Balance = 0, // because would go into negative
BucketCode = TestDataConstants.CarMtcBucketCode,
Transactions = new List<LedgerTransactionDto>
{
new LedgerTransactionDto
{
Id = id4,
Amount = 95,
Narrative = "Budgeted Amount",
TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
},
new LedgerTransactionDto
{
Id = id5,
Amount = -295.45M,
Narrative = "Fix car",
TransactionType = typeof(CreditLedgerTransaction).FullName
}
}
}
});
LedgerEntryLineDto line2 = AddEntryLineForTestData1(lines, new DateTime(2014, 1, 20));
line2.Entries.AddRange(
new[]
{
new LedgerEntryDto
{
BucketCode = TestDataConstants.RatesBucketCode,
Transactions = new List<LedgerTransactionDto>
{
new LedgerTransactionDto
{
Id = id6,
Amount = 75,
Narrative = "Budgeted Amount",
TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
}
}
},
new LedgerEntryDto
{
BucketCode = TestDataConstants.RegoBucketCode,
Transactions = new List<LedgerTransactionDto>
{
new LedgerTransactionDto
{
Id = id7,
Amount = 21.15M,
Narrative = "Budgeted Amount",
TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
}
}
},
new LedgerEntryDto
{
BucketCode = TestDataConstants.CarMtcBucketCode,
Transactions = new List<LedgerTransactionDto>
{
new LedgerTransactionDto
{
Id = id8,
Amount = 95,
Narrative = "Budgeted Amount",
TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
}
}
}
});
LedgerEntryLineDto line3 = AddEntryLineForTestData1(lines, new DateTime(2014, 02, 20));
line3.Entries.AddRange(
new[]
{
new LedgerEntryDto
{
BucketCode = TestDataConstants.RatesBucketCode,
Transactions = new List<LedgerTransactionDto>
{
new LedgerTransactionDto
{
Id = id9,
Amount = 75,
Narrative = "Budgeted Amount",
TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
}
}
},
new LedgerEntryDto
{
BucketCode = TestDataConstants.RegoBucketCode,
Transactions = new List<LedgerTransactionDto>
{
new LedgerTransactionDto
{
Id = id10,
Amount = 21.15M,
Narrative = "Budgeted Amount",
TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
}
}
},
new LedgerEntryDto
{
BucketCode = TestDataConstants.CarMtcBucketCode,
Transactions = new List<LedgerTransactionDto>
{
new LedgerTransactionDto
{
Id = id11,
Amount = 95,
Narrative = "Budgeted Amount",
TransactionType = typeof(BudgetCreditLedgerTransaction).FullName
}
}
}
});
UpdateLineBalances(line1, null, 1999.25M);
UpdateLineBalances(line2, line1, 2001.15M);
UpdateLineBalances(line3, line2, 1801.45M);
book.Reconciliations = lines.OrderByDescending(e => e.Date).ToList();
book.Ledgers.Add(new LedgerBucketDto { BucketCode = TestDataConstants.RegoBucketCode, StoredInAccount = TestDataConstants.ChequeAccountName });
book.Ledgers.Add(new LedgerBucketDto { BucketCode = TestDataConstants.CarMtcBucketCode, StoredInAccount = TestDataConstants.ChequeAccountName });
book.Ledgers.Add(new LedgerBucketDto { BucketCode = TestDataConstants.RatesBucketCode, StoredInAccount = TestDataConstants.ChequeAccountName });
return book;
}