Closed iangregsondev closed 9 years ago
Are you still having a problem with this?
The correct method call is:
var summaryService = kernel.Get<SummaryService>()
I'm struggling here as well. Am I right that the only benefit of Ninject.MockingKernel for NSubstitute is that it will automatically generate mocks if I do not bind to something specific?
@Roemer what api are you using and what issue are you hitting?
Am I right that the only benefit of Ninject.MockingKernel for NSubstitute is that it will automatically generate mocks if I do not bind to something specific?
Yes, it's an auto mocking container. You ask it to resolve the dependencies for a class you want to test, and it will inject substitutes / mocks for you.
My test framework wraps the Ninject mocking kernel and makes it easier to write tests. Have a look at the TestsFor
base class and tests for example usage.
HI there,
I looked at the example on the wiki but the nsubstitute doesn't seem to work.
I have tried the following, any ideas ?
this.kernel = new NSubstituteMockingKernel();
var summaryService = this.kernel.GetMock(); // GetMock not available Anybody using it ?
Thanks