I was asked this in an interview, I have always read about what unit tests do, but what do they not do?
Is Unit Testing worth the effort?
Any insights? Thanks!
I was asked this in an interview, I have always read about what unit tests do, but what do they not do?
Is Unit Testing worth the effort?
Any insights? Thanks!
"Good" unit tests are meant to test units in isolation. Period.
Thus a "real" unit test will not exercise those dependencies of your class under test - that you decided to "cut out" (using mocking/stubbing).
Of course that means that you do not test assumptions how that 3rd party API will react to your calls for example. Because you mock out that 3rd party API.