How to do Setup of mocks with Ninject's MockingKernel (moq)
问题 I'm having a really hard time trying to figure how I can do .SetupXXX() calls on the underlying Mock<T> that has been generated inside the MockingKernel . Anyone who can shed some light on how it is supposed to work? 回答1: You need to call the GetMock<T> method on the MoqMockingKernel which will return the generated Mock<T> on which you can call your .SetupXXX()/VerifyXXX() methods. Here is an example unit test which demonstrates the GetMock<T> usage: [Test] public void Test() { var