Full dependency injection and testing object creations -
i've come across google video related guice framework talks full dependency injections. have been struggling write testable code , main problem objects being created inside class makes class less testable.
the video categorized classes two:
- classes responsible object creation logic (factories, etc.)
- classes responsible using injected objects (business logic)
business logic classes become testable (using class level junit tests) injecting in mocked objects. i'm happy that.
however i'm left couple questions can't answer testing classes create objects.
- what test?
- how it?
Comments
Post a Comment