We use ninject in all our projects, and as you will know, sometimes it becomes hard to test if the kernel would be able to resolve every type at execution time, because some
So, what I'm asking here is how can I know that my kernel, after loading all modules and bindings, will be able to resolve every type ? Do you do any kind of Unit Test?
I test this by looping over each of the bindings in my module(s) and checking that the Kernel can return something for them:
[Test]
public void AllModuleBindingsTest()
{
var kernel = new StandardKernel(new MyNinjectModule())
foreach (var binding in new MyNinjectModule().Bindings)
{
var result = kernel.Get(binding.Service);
Assert.NotNull(result, $"Could not get {binding.Service}");
}
}