While I do see the benefits of IoC containers (as I’ve used them a fair bit), I don’t see how they can be incorporated within TDD.
When I TDD, I refactor constructors to use IoC, so that I can inject fake dependencies wherever I might need to. Implementing a container implies that I’d be deviating from the red-green-refactor-repeat loop and adding code that wouldn’t be covered by my tests.
Now let’s say that you somehow (with great design prowess) managed to hook in a container in your TDD life-cyle. You certainly aren’t meant to create instances in your unit test by resolving dependencies, as strictly speaking, that turns it into an integration test (bringing in multiple production components).
So my questions are: 1) In what scenario might you require a container within TDD? 2) Assuming a valid scenario for (1) exists, how would you go about incorporating a container without breaking away from red-green-refactor-repeat?