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.
Log in to continue
We're a place where coders share, stay up-to-date and grow their careers.
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.