Added new string assert functions#1101
Conversation
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.