3 ms·
I've always found passing objects explicitly to be superior to DI when it comes to unit testing as well. Build the object you want, then test any expected side
by mywittyname 7y ago
I've always found passing objects explicitly to be superior to DI when it comes to unit testing as well. Build the object you want, then test any expected side-effects of the method. And if you can't construct an object exactly as needed, then mock objects work almost as well.
- mateuszf 7y agoIt's not superior, because it's still DI but manual not automatic.