Can I execute the body of a virtual method that lives on an abstract class which has been mocked using Rhino Mocks?
To be clear, I\'m not trying to mock the behavior
You need to tell Rhino.Mocks to call back to the original implementation instead of doing its default behavior of just intercepting the call:
var mock = MockRepository.GenerateMock();
mock.Setup(m => m.Foo()).CallOriginalMethod(OriginalCallOptions.NoExpectation);
Now you can call the Foo()
method on your mock
object.