In some of my web applications I use Rhino Mocks to create mock objects. Usually the code has a record section where the expected calls are recorded, and a playback section where the testing is done. In the following code snippet the DoSomething() function calls a void function which is defined in the interface of _myMock. The problem is this void function is not expected and the NUnit test run will fail:
Rhino.Mocks.Exceptions.ExpectationViolationException : IMyInterface.MyVoidFunction; Expected #0, Actual #1.
/* insert expectation for void function here */
// DoSomething calls the mocked object's GetValue function, which returns 'b' when the parameter is 'a'
// DoSomething also calls a void function which is located in the interface of the mocked object, so this
// void function must be mocked too, else the test run will fail