private ExceptionThrownMessage CreateMessageWithInnerExceptions() { var information = new ExceptionInformation { Invocation = "Invocation", Message = "Message", StackTrace = "StackTrace" }; var innerInformation = new ExceptionInformation { Invocation = "Inner Invocation", Message = "Inner Message", StackTrace = "Inner StackTrace" }; return new ExceptionThrownMessage { Exception = information, InnerExceptions = new[] { innerInformation } }; }
private ExceptionThrownMessage CreateMessage() { var information = new ExceptionInformation { Invocation = "Invocation", Message = "Message", StackTrace = "StackTrace" }; return new ExceptionThrownMessage { Exception = information }; }
public ExceptionInformation CreateExceptionInformation(IInvocation invocation, Exception exception) { string invocationDetails = m_Converter.Convert(invocation); var information = new ExceptionInformation { Invocation = invocationDetails, Message = exception.Message, StackTrace = exception.StackTrace }; return information; }
public void Setup() { m_Exception = new ArgumentException("Test"); var information = new ExceptionInformation { Invocation = "Invocation", Message = m_Exception.Message, StackTrace = m_Exception.StackTrace }; m_Sut = new ExceptionThrownMessage { Exception = information }; }
private static string InnerException(ExceptionInformation[] informationArray) { if ( informationArray == null ) { return string.Empty; } string innerExceptions = string.Empty; foreach ( ExceptionInformation information in informationArray ) { innerExceptions += "Inner Exception:" + Environment.NewLine; innerExceptions += ExceptionInformationToString(information); } return innerExceptions; }
public void CreateInnerExceptionInformations(List <ExceptionInformation> exceptions, Exception exception) { Exception innerException = exception.InnerException; if ( innerException == null ) { return; } var information = new ExceptionInformation { Invocation = "InnerException", Message = innerException.Message, StackTrace = innerException.StackTrace }; exceptions.Add(information); // ReSharper disable once TailRecursiveCall CreateInnerExceptionInformations(exceptions, innerException); }