by bencoder · 6y ago · 0 comments
And there-in lies the problem. Remove the idea that the unit is a single method/function.
I subscribe to the idea that a unit is a unit of functionality. Nothing to do with the code implementation.
Only mock where you're reaching out outside of your codebase (filesystem, network, operating system (time, for ex.))
You can still do unit tests for individual functions when you need to work on a complicated algorithm, but those functions should have no dependencies or side effects - pass in all the data you need
No comments yet.