I think it would be a lot easier to mock method behavior if method/property callbacks where allowed when recording/setting expectations.
It could be achieved by adding a
Callback method to the
IMockBehavior interface:
Callback(MockMethodCalledEventHandler mockMethodCalled)
Or by adding
ExpectAndCallback and
Calback methods to the
RecordExpectations class:
public IMockBehavior ExpectAndCall(
object mockedStatements,
object returnValue,
MockMethodCalledEventHandler mockMethodCalled
);
public IMockBehavior Call(
MockMethodCalledEventHandler mockMethodCalled
);