Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Comment on lines +52 to +53
Copy link

Copilot AI Nov 25, 2025

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.

Suggested change
StringAssert.IsNotNullNorEmpty(string? actual);
StringAssert.IsNotNullNorEmpty(string? actual,
StringAssert.IsNotNullOrEmpty(string? actual);
StringAssert.IsNotNullOrEmpty(string? actual,

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Nov 25, 2025

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.

Suggested change
StringAssert.IsNotNullNorWhiteSpace(string? actual);
StringAssert.IsNotNullNorWhiteSpace(string? actual,
StringAssert.IsNotNullOrWhiteSpace(string? actual);
StringAssert.IsNotNullOrWhiteSpace(string? actual,

Copilot uses AI. Check for mistakes.
string message, params object[] args);
```

## See Also
Expand Down