My personal experience is that this kind of tests become more of a burden than benefit in a long run. I should know, I've written thousands of tests like in this post. The number one reason why I want tests is safety when refactoring the solution. However, tests with too small unit don't support this. It' rare that refactoring happens in such a limited scope and therefore tests need to be modified simultaniously with production code, which scares me.
Nowadays I write unit tests with larger scope and I recommend giving it a try!
I think unit tests are not always appropriate. If you're trying to test code which is largely business logic I'd go with unit testing, for example. If you're trying to test code which is very network intensive I would do integration testing or something along those lines instead. You end up doing so much mocking in those situations that it becomes apparent that you're making a lot of assumptions (i.e., the benefit is negligible).
Pick the right tool for the job I suppose.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My personal experience is that this kind of tests become more of a burden than benefit in a long run. I should know, I've written thousands of tests like in this post. The number one reason why I want tests is safety when refactoring the solution. However, tests with too small unit don't support this. It' rare that refactoring happens in such a limited scope and therefore tests need to be modified simultaniously with production code, which scares me.
Nowadays I write unit tests with larger scope and I recommend giving it a try!
For further reading: taimila.com/blog/unit-of-unit-test...
I think unit tests are not always appropriate. If you're trying to test code which is largely business logic I'd go with unit testing, for example. If you're trying to test code which is very network intensive I would do integration testing or something along those lines instead. You end up doing so much mocking in those situations that it becomes apparent that you're making a lot of assumptions (i.e., the benefit is negligible).
Pick the right tool for the job I suppose.