-
Notifications
You must be signed in to change notification settings - Fork 78
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
Readable assertion messages on failure. #155
Readable assertion messages on failure. #155
Conversation
Thank you @CaptnCodr |
Yes, I did now. While writing the tests we may consider to have an operator that returns a full exception to check it's types and messages. You come not far with |
In the last commit I merged the assertion syntax from Xunit to MsTest tests to have tests identical. |
[<TestMethod>] member test. | ||
``11 should be greater than 10`` ()= | ||
11 |> should be (greaterThan 10) | ||
|
||
[<TestMethod>] member test. | ||
``11.1 should be greater than 11.0`` ()= | ||
``11,1 should be greater than 11,0`` ()= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you replaced .
in test names by ,
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests with .
doesn't show up in my test explorer. Should I undo this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in VS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it already fixed microsoft/testfx#682
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in VS 16.6.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discovered that tests with period in their name are shown in a separate section within the test explorer.
In the coming PR I will undo this, because they're still there. I'm not satisfied with the ,
or other sequences (e.g. ..
) inside the test name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged and released as v3.9.0 |
Thank you guys! |
This fixes the assertion for Xunit and MsTest in #154 which prints on e.g.:
Ok "hello" |> should equal (Ok "world")
This result on failure:
Equals Ok "world" was Microsoft.FSharp.Core.FSharpResult`2[System.String,System.Object]
It's now printing:
Equals Ok "world" was Ok "hello"
Btw. I made some code cleanup.