Skip to content

Conversation

@sgaunet
Copy link
Owner

@sgaunet sgaunet commented Dec 7, 2025

  • Refactor App.New() to accept PostgreSQLClient interface parameter
  • Add NewDefault() convenience constructor for production use
  • Update all tests to inject mock clients via New() constructor
  • Remove tight coupling between App and PostgreSQLClientImpl
  • Enable dependency injection pattern for improved testability

This follows constructor dependency injection pattern and makes it easier
to test App without database dependencies.

Implements #28

- Refactor App.New() to accept PostgreSQLClient interface parameter
- Add NewDefault() convenience constructor for production use
- Update all tests to inject mock clients via New() constructor
- Remove tight coupling between App and PostgreSQLClientImpl
- Enable dependency injection pattern for improved testability

This follows constructor dependency injection pattern and makes it easier
to test App without database dependencies.

Implements #28
@sgaunet sgaunet self-assigned this Dec 7, 2025
@sgaunet sgaunet added the chore Chore label Dec 7, 2025
@sgaunet sgaunet linked an issue Dec 7, 2025 that may be closed by this pull request
8 tasks
@sgaunet sgaunet merged commit 7eb08db into main Dec 7, 2025
5 checks passed
@sgaunet sgaunet deleted the 28-refactor-appnew-to-accept-client-dependency-for-better-testability branch December 7, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor App.New() to accept client dependency for better testability

2 participants