You can use WhenCalled
. Actually I didn't understand your question (Is the event fired by the mock or by the unit under test? Who is handling the event?)
There is some sample code:
bool fired = false;
// set a boolean when the event is fired.
eventHandler.Stub(x => x.Invoke(args)).WhenCalled(call => fired = true);
// dynamically return whether the eventhad been fired before.
mock
.Stub(x => x.ReceivePayment())
.WhenCalled(call => call.ReturnValue = fired)
// make rhino validation happy, the value is overwritten by WhenCalled
.Return(false);
When you trigger the event in your test, you could also reconfigure the mock after firing:
mock
.Stub(x => x.ReceivePayment())
.Return(false);
paymentSysProvider.Raise(x => x.CashInEvent += null, cashInEventArgs);
mock
.Stub(x => x.ReceivePayment())
.Return(true)
.Repeat.Any(); // override previous return value.