DEV Community

Discussion on: You don't know TDD

Collapse
 
serhuz profile image
Sergei Munovarov

DAL/DAL/REPO layer mustn't be mocked. Why?. Simply, the objective is to test a function that works with the database.

But you could just test your DAOs/repositories with, say, in-memory DB instance in isolation. And nothing prevents you from using mocks with other application-level tests.

Collapse
 
stilldreaming1 profile image
still-dreaming-1 • Edited

I would still be worried that the in memory database does not behave the same, and this would hide many bugs that would otherwise be caught by using the real database engine.