Test database interactions
Test a database repository layer across all CRUD operations and constraint violations using isolated test databases or transaction rollbacks.
Preview
Copy prompt
Write a full test suite for the following database repository layer: [Paste code]. Use a [dedicated test database / in-memory database / transaction rollback] isolation strategy to ensure tests are independent and do not affect each other. Cover create, read by ID, list with filters, update, delete, and constraint violation scenarios. Show the complete setup and teardown logic needed to initialise and clean the test database state.
More
Testing
Prompts
