Skip to content

Conversation

@OsirisTerje
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a 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 IsNullOrEmpty and IsNotNullNorEmpty method signatures for null/empty string checks
  • Added IsNullOrWhiteSpace and IsNotNullNorWhiteSpace method 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.

Comment on lines +52 to +53
StringAssert.IsNotNullNorEmpty(string? actual);
StringAssert.IsNotNullNorEmpty(string? actual,
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.
Comment on lines +60 to +61
StringAssert.IsNotNullNorWhiteSpace(string? actual);
StringAssert.IsNotNullNorWhiteSpace(string? actual,
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.
@OsirisTerje OsirisTerje merged commit 708530f into master Nov 25, 2025
7 checks passed
@OsirisTerje OsirisTerje deleted the stringassertadditions branch November 25, 2025 15:24
github-actions bot pushed a commit that referenced this pull request Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants