When creating methods, should every object instantiated inside that method be passed in as a parameter so that those objects can be mocked in our unit tests?
We have a lot of methods here at work that have no associated unit tests and upon writing tests retrospectively; we find that there are quite a lot of objects instantiated inside these methods.
One of our options is to refactor our current methods into more unit like methods and reduce the number of responsibilities per methods. This could be quite a lengthy process but most certainly be a large benefit to us in the future.
What do you think? Should all objects instantiated inside a method be passed in as parameters?