Writing better tests
In this last chapter of this series we will be discussing some tips to write better tests.
These three posts were ...
For further actions, you may consider blocking this person and/or reporting abuse
I'm relatively new to writing tests, but the approach you suggest for not mocking the repository means a database needs to be up in order to run the unit tests, which kind of defeats the purpose of testing in isolation. am I missing some details about how you do that test?
Hi Agustin, thanks for your comment.
You are correct, when doing unit tests the access point to database should be mocked. Database interaction is outside the boundary of the unit we are testing.
The approach suggested is to do not mock it when doing integration tests that are testing this communication.