Beispiel #1
0
        void LogProcessedMessageException(ProcesedMessageException exception)
        {

            Exception ex = exception;
            while(ex.InnerException != null) 
            {
                ex = ex.InnerException;
            }
            _eventTracing.Message_processing_Exception(
                _configuration.InstanceName, 
                _configuration.MachineName, 
                exception.MessageType, 
                exception.EventID.ToString(), 
                exception.MessageHandler,
                ex.Message,
                ex.StackTrace
            );
        }
 public void ProcesedMessageExceptionSequence()
 {
     var sut = new ServiceEvents();
     var callbackCalled = false;
     var message = new ProcesedMessageException(
         Guid.NewGuid(),
         StringExtension.RandomString(),
         StringExtension.RandomString(),
         StringExtension.RandomString(),
         new ArgumentException()
         );
     
     sut.ProcesedMessageExceptionSequence.Subscribe(i =>
     {
         Assert.Same(i, message);
         callbackCalled = true;
     });
     sut.AddProcesedMessageException(message);
     Assert.True(callbackCalled);
 }