Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Thanks for the reply. Although I understand in general terms what you say, I still have a hard time realizing why providing a "base" mock set - with the ability for every test to overwrite that mock with its own implementarion (as simple as instantiating a new mock over the original) is that much of a problem - considering the fact that the code duplication it prevents is not that easy. I understand the approach in writing UTs is different than that of designing a software component, but still... Commented Apr 2, 2024 at 19:54
  • It's not always a problem, its just a downside of the approach you have to balance Commented Apr 2, 2024 at 20:26
  • All right. For clarify, I think the answer should emphasize it's a matter of what's the best trade-off for you. Choosing this over that approach will give you X but deprive of Y. Commented Apr 2, 2024 at 22:08