UnitTesting - Using AsUnit, how to "inject" proper dependancies when running tests?
Hello all.
When i'm running my tests, how do i ensure that my dependancies are 'injected'? I can manually inject them in the setUp() function, is this the way it would normally be done?
Any suggestions would be appreciated!
jos
ps. I'm using Sprouts for automating a bunch of this stuff, but the question is still primarily an AsUnit/Robotlegs/DI question.
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Joel Hooks on 29 Nov, 2009 03:43 AM
You are on the right track Jos. You want to unit test your classes outside of the framework (in isolation), so manually providing the dependencies is the way to go. Otherwise you'd need to set up the injection rules in your tests, which would be just as verbose (and in the realm of integration testing, imo).
3 Posted by Jos Yule on 29 Nov, 2009 03:52 AM
Ok, great, that's very straight forward.
Thanks again,
jos