Skip to content

feat: add ComplyWith to string-specialized Elements#952

Merged
vbreuss merged 2 commits into
mainfrom
topic/add-ComplyWith-to-string-specialized-Elements
May 16, 2026
Merged

feat: add ComplyWith to string-specialized Elements#952
vbreuss merged 2 commits into
mainfrom
topic/add-ComplyWith-to-string-specialized-Elements

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented May 16, 2026

The Elements class for IEnumerable<string?> and IAsyncEnumerable<string?> was missing the ComplyWith overload that its generic siblings expose. This made That(stringCollection).All().ComplyWith(it => ...) and related quantifier chains fail to compile.

Add the parallel overload on both sync and async sides.

@vbreuss vbreuss self-assigned this May 16, 2026
@vbreuss vbreuss added the enhancement New feature or request label May 16, 2026
Copilot AI review requested due to automatic review settings May 16, 2026 16:45
@vbreuss vbreuss enabled auto-merge (squash) May 16, 2026 16:45
Copy link
Copy Markdown

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 the missing ComplyWith(Action<IThatSubject<string?>>) overload to the string-specialized Elements types for both IEnumerable<string?> and IAsyncEnumerable<string?>, enabling quantifier chains like That(strings).All().ComplyWith(...) to compile and behave like the generic Elements<TItem> variants.

Changes:

  • Add ComplyWith(...) to ThatEnumerable.Elements (string specialization) and ThatAsyncEnumerable.Elements (string specialization).
  • Add/extend tests to cover ComplyWith on IEnumerable<string?> and IAsyncEnumerable<string?> quantifier chains.
  • Update API approval baselines (aweXpect_netstandard2.0, aweXpect_net8.0, aweXpect_net10.0) to include the new public methods.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Tests/aweXpect.Tests/Collections/ThatEnumerable.All.ComplyWith.StringTests.cs New tests covering ComplyWith for IEnumerable<string?> quantifiers.
Tests/aweXpect.Tests/Collections/ThatAsyncEnumerable.All.ComplyWith.Tests.cs Adds string-specific tests for async ComplyWith and minor formatting cleanup.
Tests/aweXpect.Api.Tests/Expected/aweXpect_netstandard2.0.txt Updates API baseline to include ThatEnumerable.Elements.ComplyWith(...) for IEnumerable<string?>.
Tests/aweXpect.Api.Tests/Expected/aweXpect_net8.0.txt Updates API baseline for both sync and async string-specialized Elements.ComplyWith(...).
Tests/aweXpect.Api.Tests/Expected/aweXpect_net10.0.txt Updates API baseline for both sync and async string-specialized Elements.ComplyWith(...).
Source/aweXpect/That/Collections/ThatEnumerable.Elements.ComplyWith.cs Adds the string-specialized Elements.ComplyWith(...) implementation (sync).
Source/aweXpect/That/Collections/ThatAsyncEnumerable.Elements.ComplyWith.cs Adds the string-specialized Elements.ComplyWith(...) overload (async).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 16, 2026

Test Results

     23 files   - 27       23 suites   - 27   7m 47s ⏱️ -24s
 19 800 tests  -  7   19 799 ✅  -  7  1 💤 ±0  0 ❌ ±0 
102 278 runs   - 33  102 277 ✅  - 33  1 💤 ±0  0 ❌ ±0 

Results for commit 9ad9a34. ± Comparison against base commit 0d5b1a9.

This pull request removes 3179 and adds 3172 tests. Note that renamed tests count towards both.
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message12c19317-9678-49d7-8045-476bfa8ca0f4")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message1b8ae02a-c9af-40b0-8651-f00ac994de7e")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message23a743d4-a1ee-4ff8-9ddf-8b5c2e445d6b")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messagebd4a478e-a271-4387-ad64-08c511ca95d7")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messagec109d9fa-2755-417a-b10b-9164bcda85c7")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messagec50d2ef1-8fa2-4ec0-aac9-54f3f911e74a")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message18312147-72c0-4ecd-bb7b-72c3bf0b4cc7")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message56222109-654c-446a-b4db-a1027f975009")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message57715e0a-227b-4004-8bdf-955b471329b5")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message860c3357-3880-4a80-a35e-c0482aed8209")
…
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message2a6483a0-102d-48c7-82dd-8712e0e37666")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message5492520c-00b7-4c7f-8b28-172fd2446a5a")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message8574b6c1-3e49-42d1-8ec9-e64b595b32e4")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "message8e4e5716-73d7-451e-ac7a-256ae9e53b96")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messageafdd2dc5-e8ea-4e6f-acf3-91da675e9744")
aweXpect.Core.Tests.Core.Exceptions.FailExceptionTests ‑ Message_ShouldBeSet(message: "messageb06d9883-ecf3-4285-9db6-f51ed289f2d0")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message2d899f42-9f6e-490d-adff-1ea2a84eb491")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message345c4f0e-fcdf-4cf0-a907-ce49d42e475a")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message4bca1806-04c3-420e-a463-657f526de052")
aweXpect.Core.Tests.Core.Exceptions.SkipExceptionTests ‑ Message_ShouldBeSet(message: "message5462f6e2-aeae-4b9e-a700-deb8324c969f")
…

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 16, 2026

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
Intel Xeon Platinum 8370C CPU 2.80GHz (Max: 2.79GHz), 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.300
[Host] : .NET 8.0.27 (8.0.27, 8.0.2726.22922), X64 RyuJIT x86-64-v4

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Method Mean Error StdDev Gen0 Gen1 Allocated
Bool_aweXpect 266.3 ns 6.22 ns 5.81 ns 0.0277 - 696 B
Bool_FluentAssertions 275.4 ns 6.73 ns 6.30 ns 0.0377 - 952 B
Equivalency_aweXpect 328,532.8 ns 1,314.05 ns 1,164.87 ns 13.1836 0.4883 335444 B
Equivalency_FluentAssertions 2,363,775.4 ns 33,866.34 ns 30,021.63 ns 191.4063 31.2500 4804891 B
Int_GreaterThan_aweXpect 270.5 ns 5.62 ns 4.98 ns 0.0343 - 864 B
Int_GreaterThan_FluentAssertions 270.5 ns 2.90 ns 2.71 ns 0.0486 - 1224 B
ItemsCount_AtLeast_aweXpect 504.0 ns 7.09 ns 6.28 ns 0.0534 - 1360 B
ItemsCount_AtLeast_FluentAssertions 499.1 ns 9.78 ns 8.67 ns 0.0792 - 2008 B
String_aweXpect 497.1 ns 11.88 ns 11.11 ns 0.0448 - 1128 B
String_FluentAssertions 1,278.3 ns 20.16 ns 18.86 ns 0.1564 - 3944 B
StringArray_aweXpect 1,654.9 ns 16.57 ns 14.69 ns 0.1030 - 2624 B
StringArray_FluentAssertions 1,424.7 ns 33.94 ns 31.74 ns 0.1640 - 4152 B
StringArrayInAnyOrder_aweXpect 2,177.9 ns 7.49 ns 7.00 ns 0.1106 - 2816 B
StringArrayInAnyOrder_FluentAssertions 70,228.6 ns 314.87 ns 294.53 ns 1.9531 - 57488 B

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 16, 2026

👽 Mutation Results

Mutation testing badge

aweXpect

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants
That/Collections/ThatAsyncEnumerable.Elements.ComplyWith.cs 69.70% 20 1 3 9 13 8 23 10 54
That/Collections/ThatEnumerable.Elements.ComplyWith.cs 78.43% 80 3 0 19 28 32 80 22 162

The final mutation score is 76.30%

Coverage Thresholds: high:80 low:60 break:0

aweXpect.Core

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

Coverage Thresholds: high:80 low:60 break:0

The Elements class for IEnumerable<string?> and IAsyncEnumerable<string?>
was missing the ComplyWith overload that its generic siblings expose.
This made `That(stringCollection).All().ComplyWith(it => ...)` and
related quantifier chains fail to compile.

Add the parallel overload on both sync and async sides.
Copilot AI review requested due to automatic review settings May 16, 2026 17:24
@vbreuss vbreuss force-pushed the topic/add-ComplyWith-to-string-specialized-Elements branch from 54349fc to a6d92a3 Compare May 16, 2026 17:24
Copy link
Copy Markdown

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@vbreuss vbreuss force-pushed the topic/add-ComplyWith-to-string-specialized-Elements branch from a6d92a3 to 9ad9a34 Compare May 16, 2026 17:33
@sonarqubecloud
Copy link
Copy Markdown

@vbreuss vbreuss merged commit 2e3e0f0 into main May 16, 2026
13 checks passed
@vbreuss vbreuss deleted the topic/add-ComplyWith-to-string-specialized-Elements branch May 16, 2026 17:42
github-actions Bot added a commit that referenced this pull request May 16, 2026
github-actions Bot added a commit that referenced this pull request May 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This is addressed in release v2.34.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