-
Notifications
You must be signed in to change notification settings - Fork 743
Change Error Message for Assert.Equals #1954
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
Comments
Should the summary and ReferenceEquals also be updated? |
@JustinRChou That makes sense |
Whoops! 😄 |
Also looks like following classes needs updating too.
And subsequent test cases. |
@rprouse Can of worms? 😄 I think most of this can wait till after the release though. |
When is the next release?
And should the EditorBrowsable attribute be applied to ReferenceEquals? I am not too familiar on how the attribute works. |
@JustinRChou In a few days. After much experimentation, I believe we have found that EditorBrowsable is no help at all for these messages. Feel free to experiment further. 😄 |
Sure. Might not have to update the test cases since those use StartsWith. |
Update summary and exception of overriden Equals and ReferenceEquals with "DO NOT USE" and suggestions of the correct methods to use.
@nunit/core-team |
I commented on the PR. I'm a little confused about what you did. You only created the PR an hour ago, how did it end up having so many things merged into it? Did you create your branch from an updated master branch? |
That was what I am trying to figure out. Before that, I was updating my fork with the new updates and I created another branch from that for the PR. So I am guessing that I am doing something incredibly wrong in my fork. |
Update summary and exception of overriden Equals and ReferenceEquals with "DO NOT USE" and suggestions of the correct methods to use.
Rebased my fork and recreated the PR. |
Removed incorrect suggestions for ReferenceEquals. Changed summary of ReferenceEquals to match the style of Equals. Added . to exception messages.
…essage #1954 assert equals error message fixed
Update summary and exception of overriden Equals and ReferenceEquals with "DO NOT USE" and suggestions of the correct methods to use.
Removed incorrect suggestions for ReferenceEquals. Changed summary of ReferenceEquals to match the style of Equals. Added . to exception messages.
* Added tests for zero-case tests * Implemented fix to allow zero-case tests to pass * Simplified parameterize condition to any test builder * Correct tests to no longer expect non-runnable when there is no data provided * Use TestParametersDictionary if present rather than TestParameters * NUnitLite taking responsibility for parsing test params * Made ExactCount standalone and added Items no-op * Added Exactly syntax tests * nunit#1954 Assert Equals Error Message Update summary and exception of overriden Equals and ReferenceEquals with "DO NOT USE" and suggestions of the correct methods to use. * Add AttributeUsage to two attributes * nunit#1954 Update for Review Removed incorrect suggestions for ReferenceEquals. Changed summary of ReferenceEquals to match the style of Equals. Added . to exception messages. * Fixed typos in comments incl XML docs * Fixed typos in private methods and test names * Fixed typo in exception message * Additional tests for pr 1942 * Fix test errors * Cleanup and add tests
Uh oh!
There was an error while loading. Please reload this page.
Based on the number of votes on this StackOverflow question, http://stackoverflow.com/questions/11584429/nunits-assert-equals-throws-exception-assert-equals-should-not-be-used-for-ass, many users find the message in our
Assert.Equals
override to be confusing. It currently says "Assert.Equals should not be used for Assertions", we should change it to be "Assert.Equals should not be used for Assertions, use Assert.AreEqual(...) instead".The text was updated successfully, but these errors were encountered: