0

How can I stub out methods that explicitly implement an interface using Rhino Mocks?

As I understand it, Rhino Mocks requires stubbed out methods to be virtual, and explicitly implemented interface members are not virtual.

Ben Aston
  • 53,718
  • 65
  • 205
  • 331
  • Is this in relation to a PartialMock? If not, if you just have an interface dependency, you can create a stub for the interface and then stub out the methods and return values for testing. – PatrickSteele May 06 '10 at 11:50

1 Answers1

1

Not currently. In fact, the feature of intercepting explicitly implemented interface members just got fixed yesterday in the Dynamic Proxy code (Rhino Mocks uses Dynamic Proxy under-the-covers to intercept method calls):

http://support.castleproject.org/projects/DYNPROXY/issues/view/DYNPROXY-ISSUE-107

PatrickSteele
  • 14,489
  • 2
  • 51
  • 54