I am trying to set up expectations on methods of a mocked object in Moq. At the same time, using Ninject, I try to have the kernel return my set up mock whenever a caller wants the corresponding interface. For more clarity, here's some pseudocode
Class Car {
Void buildChassis() {
Engine = ObjectBuilder.get<Iengine>()
Engine.performCheckup()
}
}
When testing buildChassis, I want to plug in a mocked Engine.
Mock<Iengine>().setup().etc.etc.etc
However, Moq doesn't play nice with Ninject : I can't achieve this. I'm wondering if there are any robust software packages around which integrate both DI and mocking. I can't get the ninject.moq package working, nor does it seem to be mature.