Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ninject how to check a binding for a given type is available without creating an instance

So I m just trying to test my modules, normally i would go and create a Kernel with the given module and then try to get an instance, however this scenario involves a few modules and it would be nicer if I could check that certain modules have access to certain Bindings (ie that implement and interface)

Is there any way to check if a binding for a given type is available without creating and instance of the class (ie so I don't have to make sure those dependencies are there)?

like image 829
roundcrisis Avatar asked Mar 31 '11 15:03

roundcrisis


1 Answers

Damn, of course as soon as I posted I found that in the Kernel, there is a GetBindings() method that does pretty much what I need.

Hope this helps to someone

like image 131
roundcrisis Avatar answered Oct 18 '22 23:10

roundcrisis