public void CreateExceptionWithErrorCodeAndMessageConstructor_Passing(ErrorCode code, string message, string errorMessage) { DemoException ex = new DemoException(code, testMessage); Assert.Equal(code, ex.ErrorCode); Assert.Equal(message, ex.Message); Assert.Equal(errorMessage, ex.ErrorMessage()); }
public void CreateExceptionWithMessageConstructor_Passing(ErrorCode code, string message, string errorMessage) { DemoException ex = new DemoException(message); if (code != ErrorCode.OK) { ex.ErrorCode = code; } Assert.Equal(code, ex.ErrorCode); Assert.Equal(message, ex.Message); Assert.Equal(errorMessage, ex.ErrorMessage()); }