C# Class BudgetAnalyser.Engine.UnitTest.TestData.LedgerBookTestData

Mostra file Open project: Benrnz/BudgetAnalyser Class Usage Examples

Public Methods

Method Description
TestData1 ( ) : LedgerBook

A Test LedgerBook with data populated for June, July and August 2013. Also includes some debit transactions.

TestData2 ( ) : LedgerBook

A Test LedgerBook with data populated for June July and August 2013. Also includes some debit transactions. August transactions include some balance adjustments. THIS SET OF TEST DATA IS SUPPOSED TO BE THE SAME AS THE EMBEDDED RESOURCE XML FILE: LedgerBookRepositoryTest_Load_ShouldLoadTheXmlFile.xml

TestData3 ( ) : LedgerBook

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.

TestData4 ( ) : LedgerBook

Same as Test Data 2, but with multiple Bank Balances for the latest entry. A Test LedgerBook with data populated for June July and August 2013. Also includes some debit transactions. August transactions include some balance adjustments.

TestData5 ( Func ctor = null ) : LedgerBook

A Test LedgerBook with data populated for June July and August 2013. Also includes some debit transactions. There are multiple Bank Balances for the latest entry, and the Home Insurance bucket in a different account.

Private Methods

Method Description
CreateLedgerEntry ( LedgerBucket ledger, decimal balance ) : LedgerEntry
CreateLine ( System.DateTime date, IEnumerable bankBalances, string remarks ) : LedgerEntryLine
Finalise ( LedgerBook book, bool unlock = false ) : void

Makes sure that the IsNew property on LedgerBook EntryLines is not set to true, as it will be when they are newly created. Also ensures the StoredInAccount property for each ledger is set.

LedgerBookTestData ( ) : System
SetEntriesForTesting ( this line, List entries ) : LedgerEntryLine
SetTransactionsForTesting ( this entry, List transactions ) : LedgerEntry

Method Details

TestData1() public static method

A Test LedgerBook with data populated for June, July and August 2013. Also includes some debit transactions.
public static TestData1 ( ) : LedgerBook
return BudgetAnalyser.Engine.Ledger.LedgerBook

TestData2() public static method

A Test LedgerBook with data populated for June July and August 2013. Also includes some debit transactions. August transactions include some balance adjustments. THIS SET OF TEST DATA IS SUPPOSED TO BE THE SAME AS THE EMBEDDED RESOURCE XML FILE: LedgerBookRepositoryTest_Load_ShouldLoadTheXmlFile.xml
public static TestData2 ( ) : LedgerBook
return BudgetAnalyser.Engine.Ledger.LedgerBook

TestData3() public static method

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.
public static TestData3 ( ) : LedgerBook
return BudgetAnalyser.Engine.Ledger.LedgerBook

TestData4() public static method

Same as Test Data 2, but with multiple Bank Balances for the latest entry. A Test LedgerBook with data populated for June July and August 2013. Also includes some debit transactions. August transactions include some balance adjustments.
public static TestData4 ( ) : LedgerBook
return BudgetAnalyser.Engine.Ledger.LedgerBook

TestData5() public static method

A Test LedgerBook with data populated for June July and August 2013. Also includes some debit transactions. There are multiple Bank Balances for the latest entry, and the Home Insurance bucket in a different account.
public static TestData5 ( Func ctor = null ) : LedgerBook
ctor Func
return BudgetAnalyser.Engine.Ledger.LedgerBook