I need to create some unit tests that confirm that instance of a class responds appropriately to an event raised by another object. Passing in a mock of the 'watched' object is easy enough, but as far as I can tell, mocks in nunit don't provide a means of having the mock raise an event.
I'm considering using reflection to directly invoke the event handler on the object I'm testing, passing a reference to the mock as the 'sender', but this doesn't effectively test that my object correctly hooked the events in the first place (although now I think about it, this should probably be tested separately anyway).
It does seem like a bit of a hack, but I can't see another way of doing it; is there a better way? Also, is it possible for a mock to check that an event is hooked?