Closed Nikita-Tut closed 6 years ago
What versions of the NuGet packages are you using?
I just tried it with the latest (Ninject 3.2.2 and Moq 4.5.21) and the sample works.
Sorry, it was my mistake. The sample works, if you have di like parameters in constructor. In this case all good. But in my proj - I take implementation of interface from kernel in parameterless constructor.. And in UT I want to get from kernel mocks which I put there. I've already found another solution (bind<>().ToConstant())
Is any way to make the MockingKernel
inject dependencies in a constructor?
@juanjoseluisgarcia Yes, that’s the current behavior.
In my project when I call this method - I get exception, that object instance was not created by Moq. I follow by your description and example, but even in your example on github - (https://github.com/ninject/Ninject.MockingKernel/wiki/Examples) the same issue.