Skip to content

Conversation

@AlanBarber
Copy link
Owner

This pull request introduces comprehensive integration tests for the BitCheckApplication, covering its main operations and validating command-line behaviors and error handling. The tests are organized by operation and ensure correct functionality, proper error reporting, and correct handling of edge cases for add, check, delete, info, and list modes. Additionally, a shared test base class is introduced to provide common setup, teardown, and helper methods for all tests.

Test Infrastructure Improvements:

  • Introduced ApplicationTestBase, an abstract base class that provides common setup, teardown, and a RunApp helper method for running the application in a controlled test environment. This simplifies and unifies the structure of all operation tests.

Operation-Specific Integration Tests:

Add Operation Tests:

  • Added AddOperationTests to verify that files are only added when the --add option is enabled, existing files are skipped or checked appropriately, and hashes remain unchanged unless required.

Check Operation Tests:

  • Added CheckOperationTests to ensure that running the check operation on missing files does not remove their entries from the database when update is not requested.

Delete Operation Tests:

  • Added DeleteOperationTests to confirm that invalid combinations of the --delete flag with other options or missing required arguments produce appropriate error messages.

Info Mode Tests:

  • Added InfoModeTests to validate that info mode displays correct file tracking details, handles untracked files, enforces required arguments, and rejects invalid option combinations.

List Mode Tests:

  • Added ListModeTests to check that list mode correctly displays tracked and missing files, enforces argument requirements, and cannot be combined with other operations.

@AlanBarber AlanBarber merged commit ec3b81f into main Dec 17, 2025
6 checks passed
@AlanBarber AlanBarber deleted the macos-fix branch December 17, 2025 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants