-
-
Notifications
You must be signed in to change notification settings - Fork 722
Closed
Labels
Description
Hi,
I am using the @inject syntax to do IoC. It's working as expected.
For unit tests I needed the ability to override the binding so that I could hotswap my class with a mock. Someone in #143 suggested a clever way to this:
kernel.unbind("HttpConfig")
kernel.bind("HttpConfig").to(customHttpConfig)However, my issue is that the object I want to override is declared using this syntax:
kernel.bind<ActiveDirectory>('Helper').to(ActiveDirectory).inSingletonScope().whenTargetNamed('ActiveDirectory');Currently the only way I can override is:
kernel.unbind('Helper');
kernel.bind<ActiveDirectory>('Helper').to(MockActiveDirectory).inSingletonScope().whenTargetNamed('ActiveDirectory');The problem with this approach is that I am only interested in overriding the 'ActiveDirectory' class and not all Helpers.
Help?
MathieuDoyon, remojansen, rundef, OlivierAlbertini, wi-ski and 2 more
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done