Search code examples
unit-testingmockingrhino-mocks

Mocking classes in Rhino Mocks


Lets say there is an Interface ICreateFileStrategy. Lets say there are classes A and B that implement these two interfaces. Both these classes implement method

long CreateFile(ExportFile exportFile)

Now when I want to write a unit test I want to test method CreateFile of class A. How is this possible. How do I set the expectations exactly.

Thanks, Sai


Solution

  • for starters you test the class not the interface, so you just create an instance of Class A mock all of the dependencies and then test the method