I am trying to make following mocking
var checkComponent = MockRepository.GenerateStub<IController>();
checkComponent.Stub(r => r.GetSelector().Select(new Position(3,6,1))).Return(true);
I am getting that r.GetSelector() is returning null.
Is there a way to make mocking that i am trying to create ?
Thanks.
This is because
checkComponent(rin Stub() call) is not a real implementation of theIControllerit is basically RhinoMock proxy object which implementsIControllerinterface.You have to specify what should be returned when
GetSelector()is called,use Mock for scenarios when you need to specify expectations on methods.