public void ConstructorWithMessageAndPropertySource_ExceptionMessageCorrectlyFormatted() { var propertySource = new { Entity = "Car", Id = -1 }; var exception = new ExceptionDummy("{Entity} with id {Id} could not be found.", propertySource); Assert.Equal("Car with id -1 could not be found.", exception.Message); }
public void ConstructorWithMessageAndPropertySourceAndInnerException_InnerExceptionPreserved() { var innerException = new Exception("InnerExceptionMessage"); var exception = new ExceptionDummy("Car with id -1 could not be found.", innerException); Assert.Equal("InnerExceptionMessage", exception.InnerException.Message); }
public void ConstructorWithMessageAndInnerException_InnerExceptionPreserved() { var propertySource = new { Entity = "Car", Id = -1 }; var innerException = new Exception("InnerExceptionMessage"); var exception = new ExceptionDummy("{Entity} with id {Id} could not be found.", propertySource, innerException); Assert.Equal("InnerExceptionMessage", exception.InnerException.Message); }
public void DefaultConstructor_ReturnsDefaultMessage() { var exception = new ExceptionDummy(); Assert.Equal("Exception of type 'DryPants.Test.Exceptions.DryExceptionTests+ExceptionDummy' was thrown.", exception.Message); }
public void ConstructorWithMessage_ExceptionMessageCorrectlyFormatted() { var exception = new ExceptionDummy("Car with id -1 could not be found."); Assert.Equal("Car with id -1 could not be found.", exception.Message); }