Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

Documents NUnit PR #5052 which adds .Using(StringComparison) and .Using(CultureInfo) modifiers to SubstringConstraint, StartsWithConstraint, and EndsWithConstraint.

Changes

  • SubstringConstraint.md: Added new modifiers and usage examples
  • StartsWithConstraint.md: Added new modifiers and usage examples
  • EndsWithConstraint.md: Added new modifiers and usage examples

New Modifiers

...Using(StringComparison comparisonType)
...Using(CultureInfo culture)

Example Usage

// StringComparison
Assert.That("Hello World!", Does.Contain("WORLD").Using(StringComparison.OrdinalIgnoreCase));

// CultureInfo with case-insensitive matching
Assert.That("TITLE text", Does.StartWith("title").IgnoreCase.Using(new CultureInfo("tr-TR")));

// CultureInfo alone (case-sensitive)
Assert.That("Main Straße", Does.EndWith("Straße").Using(new CultureInfo("de-DE")));

Only one Using modifier may be specified per constraint.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.myget.org
    • Triggering command: /usr/bin/dotnet dotnet test docs/snippets/Snippets.sln (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --ignore-failed-sources (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Document Allow string comparison specification for string constraints</issue_title>
<issue_description>NUnit PR #5052 should be documented.

@nancyhuyn : Would you like to give this a spin too , since you implemented the PR ?</issue_description>

Comments on the Issue (you are @copilot in this section)

Custom agent used: NUnit.Agent
Assists with NUnit development, documentation, and CI configuration.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 25, 2025 16:55
… string constraints

Co-authored-by: OsirisTerje <203432+OsirisTerje@users.noreply.github.com>
… comparison

Co-authored-by: OsirisTerje <203432+OsirisTerje@users.noreply.github.com>
…ensitive usage

Co-authored-by: OsirisTerje <203432+OsirisTerje@users.noreply.github.com>
Copilot AI changed the title [WIP] Document string comparison specification for constraints Document Using(StringComparison) and Using(CultureInfo) modifiers for string constraints Nov 25, 2025
Copilot AI requested a review from OsirisTerje November 25, 2025 17:01
Copilot finished work on behalf of OsirisTerje November 25, 2025 17:01
@OsirisTerje OsirisTerje marked this pull request as ready for review November 25, 2025 17:07
Copy link
Member

@SeanKilleen SeanKilleen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@SeanKilleen SeanKilleen merged commit 9d92cc0 into master Nov 25, 2025
12 checks passed
@SeanKilleen SeanKilleen deleted the copilot/document-string-comparison-spec branch November 25, 2025 17:16
github-actions bot pushed a commit that referenced this pull request Nov 25, 2025
… string constraints (#1103)

* Initial plan

* Document Using(StringComparison) and Using(CultureInfo) modifiers for string constraints

Co-authored-by: OsirisTerje <203432+OsirisTerje@users.noreply.github.com>

* Fix CultureInfo examples to use more appropriate Turkish culture case comparison

Co-authored-by: OsirisTerje <203432+OsirisTerje@users.noreply.github.com>

* Improve CultureInfo examples to show both case-sensitive and case-insensitive usage

Co-authored-by: OsirisTerje <203432+OsirisTerje@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: OsirisTerje <203432+OsirisTerje@users.noreply.github.com> 9d92cc0
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.

Document Allow string comparison specification for string constraints

3 participants