The goal is to create a universal testing approach that covers functionality common to every ledger system. Applying these tests to existing software, such as CashCtrlLedger, will validate the tests and ensure consistent behavior across all systems. This will involve defining test data, expected outcomes, restoring ledger states, and implementing both integration and unit tests to guarantee consistency and correctness across different implementations.
General Test Flow:
Define Test Data:
Define mock data representing the ledger system state. On this step, Lukas' input is needed to help define robust test data.
Define Expected Outcome:
For each test case, specify the expected results, such as correct account balances, VAT amounts, or ledger entries after transactions. This step also involves Lukas' input to define proper data.
Populate Ledger System with Predefined Data:
Use the implemented method to initialize the ledger system state from the predefined test data. This will be useful, especially using pytest fixtures.
Implement Integration Tests:
Start by testing high-level functionality to ensure that the StandaloneLedger processes operations correctly.
Gradually add unit tests to validate individual methods and components, ensuring comprehensive test coverage.
Restore Initial State:
Restore the initial state of the ledger system using dump and restore logic within a fixture.
Testing Strategy:
We have chosen to focus on testing the following:
account_balance, account_history, and vat_journal_entries methods: These will implicitly test precision, account_rangefx_revaluation, and vat_codes.
Skipping other methods: For now, the rest of the methods will be skipped such as export_account_sheets as they are either implicitly tested or will be covered by unit tests, which are considered low-level and not a priority for now.
Description:
The goal is to create a universal testing approach that covers functionality common to every ledger system. Applying these tests to existing software, such as
CashCtrlLedger
, will validate the tests and ensure consistent behavior across all systems. This will involve defining test data, expected outcomes, restoring ledger states, and implementing both integration and unit tests to guarantee consistency and correctness across different implementations.General Test Flow:
Define Test Data:
Define Expected Outcome:
Populate Ledger System with Predefined Data:
Implement Integration Tests:
StandaloneLedger
processes operations correctly.Restore Initial State:
Testing Strategy:
account_balance
,account_history
, andvat_journal_entries
methods: These will implicitly testprecision
,account_range
fx_revaluation
, andvat_codes
.export_account_sheets
as they are either implicitly tested or will be covered by unit tests, which are considered low-level and not a priority for now.