-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: support strings in HasItem
#684
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
Conversation
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.
Pull Request Overview
This PR enhances the HasItem functionality to provide specialized string comparison capabilities, moving from generic object comparison to dedicated string-specific operations. The implementation adds comprehensive string matching options including prefix, suffix, wildcard, regex patterns, and various whitespace/case handling options.
- Introduces
HasItemStringResultclasses for specialized string item verification with rich comparison options - Adds string-specific
HasItemoverloads for both sync and async enumerables, includingImmutableArray<string?> - Refactors existing
HasItemObjectResultto implementIOptionsProviderinterface and movesEquivalentmethod to extension
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Source/aweXpect/That/Collections/ThatEnumerable.HasItem.cs | Adds string-specific HasItem overloads for IEnumerable<string?> and ImmutableArray<string?> |
| Source/aweXpect/That/Collections/ThatAsyncEnumerable.HasItem.cs | Adds string-specific HasItem overload for IAsyncEnumerable<string?> |
| Source/aweXpect.Core/Results/HasItemStringResult.cs | New class providing string-specific comparison methods (prefix, suffix, regex, wildcard, etc.) |
| Source/aweXpect.Core/Results/HasItemObjectResult.cs | Refactored to implement IOptionsProvider and removed Equivalent method |
| Source/aweXpect/Equivalency/EquivalencyExtensions.cs | Adds Equivalent extension method for HasItemObjectResult |
| Tests/aweXpect.Tests/Collections/ThatEnumerable.HasItem.Tests.cs | Comprehensive test coverage for new string functionality |
| Tests/aweXpect.Tests/Collections/ThatAsyncEnumerable.HasItem.Tests.cs | Test coverage for async enumerable string functionality |
| Source/aweXpect.Core/Formatting/ValueFormatters.Collection.cs | Formatting fix to prevent line breaks in string values within collections |
3d991d7 to
6682cd6
Compare
Test Results 4 files - 34 4 suites - 34 23s ⏱️ - 2m 17s Results for commit fe487ef. ± Comparison against base commit fe15b21. This pull request removes 13140 and adds 52 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
527e5d9 to
fe487ef
Compare
|
|
This is addressed in release v2.20.0. |



This PR enhances the
HasItemfunctionality to provide specialized string comparison capabilities, moving from generic object comparison to dedicated string-specific operations. The implementation adds comprehensive string matching options including prefix, suffix, wildcard, regex patterns, and various whitespace/case handling options.StringHasItemResultclasses for specialized string item verification with rich comparison optionsHasItemoverloads for both sync and async enumerables, includingImmutableArray<string?>ObjectHasItemResultto implementIOptionsProviderinterface and movesEquivalentmethod to an extension method