Search code examples
c#.netasp.netmockingrhino-mocks

What is the dfference between mocking classes and interfaces?


What's the difference between mocking classes and interfaces in Rhino Mocks?


Solution

  • You can't mock concrete classes per se, unless the class is abstract or has virtual methods. You can fake the contract of the abstract class, or override virtual methods with a faked method using Rhino Mocks.

    Mocking an interface simply means you are defining a fake implementation of said interface.