How to Use Rhino Mocks/Testing Events

Rhino Mocks can be used to test events on interfaces. For example, let's assume an interface that represents an editor view. This might in turn be implemented by an untested, lightweight user control in a WinForms application: We'll be testing the presenter class of this view. An NUnit test that asserts some action takes place due to this event being raised might look like this: