I'm getting confused here. I am from the school of thought where a Unit Test is about testing the Class Under Test, and mocking out it's immediate collaborators (some exceptions to this general rule here!).
However, some of my colleagues have a slightly different opinion in that they feel it's okay to bootstrap a Dependency Injection container in a Unit Test. To me this feels like the test is testing more than the Class Under Test because the DI container can automagically inject other dependencies which are irrelevant to the test.
Please put me out of my misery!
Aucun commentaire:
Enregistrer un commentaire