public void SameMessageAndExceptionAreEqual() { Exception ex = new Exception("ex"); ExceptionErrorMessage lhs = new ExceptionErrorMessage(ex, "message"); ExceptionErrorMessage rhs = new ExceptionErrorMessage(ex, "message"); Assert.AreEqual(lhs, rhs); }
public void FormattedErrorMessageToStringShowsMessageAndParameter() { Exception ex = new Exception("ex"); ExceptionErrorMessage lhs = new ExceptionErrorMessage(ex, "message"); Assert.AreEqual("Message \"message\" Exception \"ex\"", lhs.ToString()); }
public override bool Equals(object obj) { ExceptionErrorMessage rhs = obj as ExceptionErrorMessage; return((message == rhs.message) && (ex.Message == rhs.ex.Message)); }
public void ShowExceptionError(Exception ex, string message) { exceptionErrorMessage = new ExceptionErrorMessage(ex, message); }
public void ErrorMessageDisplayedWhenExceptionThrownLoadingSchema() { ApplicationException ex = new ApplicationException("message"); fileSystem.ExceptionToThrowWhenCopyFileCalled = ex; schemasEditor.SaveOptions(); ExceptionErrorMessage message = new ExceptionErrorMessage(ex, "${res:ICSharpCode.XmlEditor.XmlSchemasPanel.UnableToSaveChanges}"); Assert.AreEqual(message, panel.ExceptionErrorMessage); }