-
Notifications
You must be signed in to change notification settings - Fork 158
Updated EqualTo constraint #1070
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
Conversation
docs/articles/nunit/writing-tests/constraints/EqualConstraint.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Sean Killeen <[email protected]>
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.
Pull Request Overview
This PR fixes documentation and code examples for the EqualTo constraint by reorganizing the modifiers list and adding explanation for the IgnoreWhiteSpace modifier.
- Reorganized the modifiers list to remove duplicated entries and improve logical grouping
- Added a code example demonstrating the IgnoreWhiteSpace modifier usage
- Added documentation explaining that IgnoreWhiteSpace uses the same characters as C# Char.IsWhiteSpace
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
docs/snippets/Snippets.NUnit/ConstraintExamples.cs | Added code example showing IgnoreWhiteSpace modifier usage |
docs/articles/nunit/writing-tests/constraints/EqualConstraint.md | Reorganized modifiers list, removed duplicates, and added IgnoreWhiteSpace explanation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@@ -44,6 +44,7 @@ public void EqualConstraint_Strings() | |||
string[] expected = ["Hello", "World"]; | |||
string[] actual = ["HELLO", "world"]; | |||
Assert.That(actual, Is.EqualTo(expected).IgnoreCase); | |||
Assert.That("Hello my world is \r\n on fire!", Is.EqualTo("Hellomy world \r\n is on fire!").IgnoreWhiteSpace); |
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.
Fun to see our own analyzer warnings on the PR here. :) maybe extract this to a variable?
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.
Just to fool the analyzer ?
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.
Fixed
Updated EqualTo constraint fb945da
Fixed list of modifiers, removed duplicated entries
Added code to explain IgnoreWhiteSpace modifier.