This question already has an answer here:
I discover mocking strategies after 50% of tests was writen, and I'm confused about how much focus unit tests should have, for example on class method. I know that for external dependencies you should mock those but what if we call some other method in the same class. Would this considered to be dependency? ... Because we want to test correctness only the method that we are testing... right? But where unit test focus ends?
Unit test should test in OOP the smalest block of code... and 2 tests should not be dependant. So if the smallest block of code is class method, the unit test should test 1 class method only. But if someone modify one method and test for that method fails, it will fails all other method in class that depends on it. So in order to make test truly independant i should mock dependants method?
My thinking before writing my first test was that unit test is testing smallest group of code like class method or function and make assertions obout it's side effects... What are your thoughts about this and what should be best practice.