2 ms·
At the repository (data access) application layer. For a query (e.g. loading an entity): - Arrange: test database loaded with fixtures - Act: execute reposit
by noisem4ker 4y ago
At the repository (data access) application layer.
For a query (e.g. loading an entity):
- Arrange: test database loaded with fixtures
- Act: execute repository method
- Assert: returned data corresponds to fixture
For updating queries: additionally assert the new database state.
Repository tests shouldn't care nor know whether the methods under test internally execute raw SQL or use ORM methods. This allows freely switching and mixing the two.