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

FSharpCustomMessageFormatter #166

Closed
sergey-tihon opened this issue Jul 20, 2020 · 4 comments
Closed

FSharpCustomMessageFormatter #166

sergey-tihon opened this issue Jul 20, 2020 · 4 comments

Comments

@sergey-tihon
Copy link
Member

Just found in docs http://fsprojects.github.io/FsUnit/NUnit.html
image

@CaptnCodr I remember that you fixed similar issues here #155
May I ask you to take look if it still works / needed?

@CaptnCodr
Copy link
Member

Yes, I take a look.

@CaptnCodr
Copy link
Member

CaptnCodr commented Jul 20, 2020

@sergey-tihon It still works and is needed. Especially the Result-Type.
In this repro I recognized that FsUnitTyped.shouldEqual and FsUnitTyped.shouldNotEqual prints the error message twice.
First from FsUnitTyped and second from the Nunit framework:

image

We should fix this. This comes from here: bf38605#diff-fc2f5b7136e6efc18391b4ff8daa5d05R11

@CaptnCodr
Copy link
Member

CaptnCodr commented Jul 20, 2020

This fix can be achieved through removing the sprintf "Expected: %A\nActual: %A" expected actual from FsUnitTyped, but then we have no pretty print anymore.

@CaptnCodr
Copy link
Member

When I remove sprintf "Expected: %A\nActual: %A" expected actual from shouldEqual then I have to add type InitMsgUtils () = inherit FSharpCustomMessageFormatter() to the tests to have a pretty message e.g.:
image

Do we want to do that, @sergey-tihon? It's only affecting shouldEqual and shouldNotEqual with such types.

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

2 participants