public void RaiseDataProcessingExceptionOccurred() { var exception = new Exception(); string message = Guid.NewGuid().ToString(); EventHandler <ExceptionEventArgs> handler = null; handler = (s, e) => { DataPublisher.DataProcessingExceptionOccurred -= handler; Assert.AreSame(exception, e.Exception); Assert.AreEqual(message, e.Message); eventRaised = true; }; DataPublisher.DataProcessingExceptionOccurred += handler; DataPublisher.RaiseDataProcessExceptionOccurred(this, exception, message); EnqueueConditional(() => eventRaised); EnqueueTestComplete(); }