Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed assertions message formatting #13

Open
skajfes opened this issue Feb 16, 2017 · 0 comments
Open

Failed assertions message formatting #13

skajfes opened this issue Feb 16, 2017 · 0 comments

Comments

@skajfes
Copy link

skajfes commented Feb 16, 2017

Can message formatting be simplified to clear up some unecessary noise from the messages themselves, or at least to organise the message in a way that the most useful info is at the top?

For example ShouldEqual() exception returns a message like this:

Should.Core.Exceptions.EqualException : Assert.Equal() Failure
Expected: 2
Actual: 1

I would like to change the message to be something like this:

Expected: 2
Actual: 1
Assert.Equal() Failure

Or whatever else that the first line of the message includes the most useful info.
The reason I ask this is because ReSharper test runner displays the first line of the message in the test list, and it is useful to show the failure inline.

This image shows the ReSharper test runner examples. First two tests are using Nunit assertions and it is immediatelly clear what the expected result was, no extra noise. The third test is using Should assertions, and only thing that is clear is that there was an equalilty failure with a lot of verbosity and noise.

image

I can create a pull request with the required changes, but wanted to check if this is something plausible to be considered as part of the project, and to see if there are more suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant