private void PrepareTestCaseData() { TDBTransaction Transaction = null; bool AccountTestCasesAvailable = false; bool CostCentreTestCasesAvailable = false; DBAccess.GDBAccessObj.BeginAutoReadTransaction(ref Transaction, delegate { // Check if some special test data are available - otherwise load ... AccountTestCasesAvailable = AAccountAccess.Exists(LedgerNumber, "6001", Transaction); CostCentreTestCasesAvailable = ACostCentreAccess.Exists(LedgerNumber, "4301", Transaction); }); if (!AccountTestCasesAvailable) { CommonNUnitFunctions.LoadTestDataBase("csharp\\ICT\\Testing\\lib\\MFinance\\GL\\" + "test-sql\\gl-test-account-data.sql", LedgerNumber); } if (!CostCentreTestCasesAvailable) { CommonNUnitFunctions.LoadTestDataBase("csharp\\ICT\\Testing\\lib\\MFinance\\GL\\" + "test-sql\\gl-test-costcentre-data.sql", LedgerNumber); } }
private void PrepareTestCaseData() { // new database because period July has to be open FLedgerNumber = CommonNUnitFunctions.CreateNewLedger(); TDBTransaction Transaction = DBAccess.GDBAccessObj.BeginTransaction(); // Check if some special test data are available - otherwise load ... bool CostCentreTestCasesAvailable = ACostCentreAccess.Exists(FLedgerNumber, "4301", Transaction); DBAccess.GDBAccessObj.RollbackTransaction(); if (!CostCentreTestCasesAvailable) { CommonNUnitFunctions.LoadTestDataBase("csharp\\ICT\\Testing\\lib\\MFinance\\GL\\" + "test-sql\\gl-test-costcentre-data.sql", FLedgerNumber); } }
private void PrepareTestCaseData() { // new database because period July has to be open FLedgerNumber = CommonNUnitFunctions.CreateNewLedger(); TDBTransaction Transaction = new TDBTransaction(); TDataBase db = DBAccess.Connect("PrepareTestCaseData"); bool CostCentreTestCasesAvailable = false; db.ReadTransaction(ref Transaction, delegate { // Check if some special test data are available - otherwise load ... CostCentreTestCasesAvailable = ACostCentreAccess.Exists(FLedgerNumber, "4301", Transaction); }); db.CloseDBConnection(); if (!CostCentreTestCasesAvailable) { CommonNUnitFunctions.LoadTestDataBase("csharp\\ICT\\Testing\\lib\\MFinance\\server\\GL\\" + "test-sql\\gl-test-costcentre-data.sql", FLedgerNumber); } }