-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -43,6 +43,23 @@ StringAssert.IsMatch(string regexPattern, string actual, | |||||||||
| StringAssert.DoesNotMatch(string regexPattern, string actual); | ||||||||||
| StringAssert.DoesNotMatch(string regexPattern, string actual, | ||||||||||
| string message, params object[] args); | ||||||||||
|
|
||||||||||
| // Functions below are available in NUnit 4.5 and later | ||||||||||
| StringAssert.IsNullOrEmpty(string? actual); | ||||||||||
| StringAssert.IsNullOrEmpty(string? actual, | ||||||||||
| string message, params object[] args); | ||||||||||
|
|
||||||||||
| StringAssert.IsNotNullNorEmpty(string? actual); | ||||||||||
| StringAssert.IsNotNullNorEmpty(string? actual, | ||||||||||
| string message, params object[] args); | ||||||||||
|
|
||||||||||
| StringAssert.IsNullOrWhiteSpace(string? actual); | ||||||||||
| StringAssert.IsNullOrWhiteSpace(string? actual, | ||||||||||
| string message, params object[] args); | ||||||||||
|
|
||||||||||
| StringAssert.IsNotNullNorWhiteSpace(string? actual); | ||||||||||
| StringAssert.IsNotNullNorWhiteSpace(string? actual, | ||||||||||
|
Comment on lines
+60
to
+61
|
||||||||||
| StringAssert.IsNotNullNorWhiteSpace(string? actual); | |
| StringAssert.IsNotNullNorWhiteSpace(string? actual, | |
| StringAssert.IsNotNullOrWhiteSpace(string? actual); | |
| StringAssert.IsNotNullOrWhiteSpace(string? actual, |
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
IsNotNullNorEmptyis inconsistent with the existing pattern in StringAssert. All existing negative assertion methods follow the patternDoesNot*orAreNotEqual*(e.g.,DoesNotContain,DoesNotStartWith,DoesNotEndWith,AreNotEqualIgnoringCase). Consider renaming toIsNotNullOrEmptyto maintain consistency with the positive versionIsNullOrEmpty, or better yet, follow the existing naming pattern and use something likeDoesNotHaveNullOrEmptyif such a pattern fits.