-
Notifications
You must be signed in to change notification settings - Fork 161
Added new string assert functions #1101
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
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 adds documentation for four new StringAssert methods that provide convenient assertions for checking null, empty, and whitespace conditions in strings. These methods are classic-style assertions that complement the existing StringAssert API.
Key changes:
- Added
IsNullOrEmptyandIsNotNullNorEmptymethod signatures for null/empty string checks - Added
IsNullOrWhiteSpaceandIsNotNullNorWhiteSpacemethod signatures for null/whitespace string checks - All new methods include overloads with optional message and format arguments
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| StringAssert.IsNotNullNorEmpty(string? actual); | ||
| StringAssert.IsNotNullNorEmpty(string? actual, |
Copilot
AI
Nov 25, 2025
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.
The naming convention IsNotNullNorEmpty is inconsistent with the existing pattern in StringAssert. All existing negative assertion methods follow the pattern DoesNot* or AreNotEqual* (e.g., DoesNotContain, DoesNotStartWith, DoesNotEndWith, AreNotEqualIgnoringCase). Consider renaming to IsNotNullOrEmpty to maintain consistency with the positive version IsNullOrEmpty, or better yet, follow the existing naming pattern and use something like DoesNotHaveNullOrEmpty if such a pattern fits.
| StringAssert.IsNotNullNorEmpty(string? actual); | |
| StringAssert.IsNotNullNorEmpty(string? actual, | |
| StringAssert.IsNotNullOrEmpty(string? actual); | |
| StringAssert.IsNotNullOrEmpty(string? actual, |
| StringAssert.IsNotNullNorWhiteSpace(string? actual); | ||
| StringAssert.IsNotNullNorWhiteSpace(string? actual, |
Copilot
AI
Nov 25, 2025
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.
The naming convention IsNotNullNorWhiteSpace is inconsistent with the existing pattern in StringAssert. All existing negative assertion methods follow the pattern DoesNot* or AreNotEqual*. Additionally, the positive version uses "Or" (IsNullOrWhiteSpace) but the negative version uses "Nor", which is inconsistent. Consider renaming to IsNotNullOrWhiteSpace to maintain consistency with the positive version IsNullOrWhiteSpace.
| StringAssert.IsNotNullNorWhiteSpace(string? actual); | |
| StringAssert.IsNotNullNorWhiteSpace(string? actual, | |
| StringAssert.IsNotNullOrWhiteSpace(string? actual); | |
| StringAssert.IsNotNullOrWhiteSpace(string? actual, |
Added new string assert functions 708530f
No description provided.