Skip to content

Conversation

@vbreuss
Copy link
Contributor

@vbreuss vbreuss commented Jul 20, 2025

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 StringHasItemResult classes for specialized string item verification with rich comparison options
  • Adds string-specific HasItem overloads for both sync and async enumerables, including ImmutableArray<string?>
  • Refactors existing ObjectHasItemResult to implement IOptionsProvider interface and moves Equivalent method to an extension method

@vbreuss vbreuss self-assigned this Jul 20, 2025
Copilot AI review requested due to automatic review settings July 20, 2025 06:16
@vbreuss vbreuss added the enhancement New feature or request label Jul 20, 2025
Copy link

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 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 HasItemStringResult classes for specialized string item verification with rich comparison options
  • Adds string-specific HasItem overloads for both sync and async enumerables, including ImmutableArray<string?>
  • Refactors existing HasItemObjectResult to implement IOptionsProvider interface and moves Equivalent method 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

@vbreuss vbreuss force-pushed the topic/support-strings-for-hasitem branch from 3d991d7 to 6682cd6 Compare July 20, 2025 06:18
@github-actions
Copy link
Contributor

github-actions bot commented Jul 20, 2025

Test Results

    4 files   -     34      4 suites   - 34   23s ⏱️ - 2m 17s
  897 tests  - 13 088    896 ✅  - 13 087  1 💤  - 1  0 ❌ ±0 
2 577 runs   - 36 186  2 576 ✅  - 36 185  1 💤  - 1  0 ❌ ±0 

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.
aweXpect.Analyzers.Tests.AwaitExpectationAnalyzerTests ‑ WhenAwaited_ShouldNotBeFlagged
aweXpect.Analyzers.Tests.AwaitExpectationAnalyzerTests ‑ WhenAwaited_WithoutReturnValue_ShouldNotBeFlagged
aweXpect.Analyzers.Tests.AwaitExpectationAnalyzerTests ‑ WhenNotAwaited_ShouldBeFlagged
aweXpect.Analyzers.Tests.AwaitExpectationAnalyzerTests ‑ WhenNotAwaited_WithoutReturnValue_ShouldBeFlagged
aweXpect.Analyzers.Tests.AwaitExpectationAnalyzerTests ‑ WhenNotAwaited_WithoutReturnValue_WithVerifyInMethod_ShouldStillBeFlagged
aweXpect.Analyzers.Tests.AwaitExpectationAnalyzerTests ‑ WhenVerifiedStatically_ShouldNotBeFlagged
aweXpect.Analyzers.Tests.AwaitExpectationAnalyzerTests ‑ WhenVerifiedStatically_WithoutReturnValue_ShouldNotBeFlagged
aweXpect.Analyzers.Tests.AwaitExpectationAnalyzerTests ‑ WhenVerifiedWithStaticUsing_ShouldNotBeFlagged
aweXpect.Analyzers.Tests.AwaitExpectationAnalyzerTests ‑ WhenVerifiedWithStaticUsing_WithoutReturnValue_ShouldNotBeFlagged
aweXpect.Analyzers.Tests.AwaitExpectationAnalyzerTests ‑ WhenVerified_ShouldNotBeFlagged
…
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message233a96b5-de5b-41c7-9159-c8e4727ab02e")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message3be7f68e-cd3e-4707-a9fd-d72277186071")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messagea9a05d57-a5c6-4a34-84ed-b0bb0c1a2b85")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message0c6cb9b8-d1e9-4a3b-922a-3be341b2ced0")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message32800184-3e59-43a2-be9f-346d614f4e79")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "messagebf3a5f94-f1c5-4e97-b8c9-986c1e177c78")
aweXpect.Core.Tests.Equivalency.EquivalencyOptionsExtensionsTests ‑ Generic_For_IgnoringMember_ShouldSetOptionForType(memberToIgnore: "memberToIgnore31300174-1acd-4f42-9cd2-739efd410551")
aweXpect.Core.Tests.Equivalency.EquivalencyOptionsExtensionsTests ‑ Generic_For_IgnoringMember_ShouldSetOptionForType(memberToIgnore: "memberToIgnore45ccb2c6-6dbe-4d96-83ac-707c435985ca")
aweXpect.Core.Tests.Equivalency.EquivalencyOptionsExtensionsTests ‑ Generic_For_IgnoringMember_ShouldSetOptionForType(memberToIgnore: "memberToIgnore926b7672-2a26-4aaa-a77d-11e6bc3763d8")
aweXpect.Core.Tests.FailTests ‑ Test_ShouldThrowException(reason: "reason11741044-b45e-4307-82a4-499996f97daf")
…

♻️ This comment has been updated with latest results.

@vbreuss vbreuss enabled auto-merge (squash) July 20, 2025 10:32
@vbreuss vbreuss force-pushed the topic/support-strings-for-hasitem branch from 527e5d9 to fe487ef Compare July 20, 2025 10:37
@sonarqubecloud
Copy link

@vbreuss vbreuss merged commit b774dc8 into main Jul 20, 2025
13 checks passed
@vbreuss vbreuss deleted the topic/support-strings-for-hasitem branch July 20, 2025 10:43
@github-actions
Copy link
Contributor

This is addressed in release v2.20.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants