public void RaiseEvent() { IWithEvents eventHolder = MockRepository.Mock <IWithEvents>(); eventHolder.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault); eventHolder.ExpectEvent(x => x.Blah += null) .IgnoreArguments(); eventHolder.Expect(x => x.RaiseEvent()) .DoInstead(new System.Threading.ThreadStart(delegate() { eventHolder.Raise(x => x.Blah += null, new object[] { this, EventArgs.Empty }); })); IEventSubscriber eventSubscriber = MockRepository.Mock <IEventSubscriber>(); eventSubscriber.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault); eventSubscriber.Expect(x => x.Hanlder(this, EventArgs.Empty)); eventHolder.Blah += new EventHandler(eventSubscriber.Hanlder); eventHolder.RaiseEvent(); eventHolder.VerifyExpectations(); eventSubscriber.VerifyExpectations(); }