Skip to content

refactor!: name the collection result types after what they do - #1121

Merged
vbreuss merged 1 commit into
mainfrom
worktree-result-type-names
Sep 15, 2026
Merged

vbreuss merged 1 commit into
mainfrom
worktree-result-type-names

Conversation

@vbreuss

@vbreuss vbreuss commented Sep 15, 2026

Copy link
Copy Markdown
Member

Contain and BeContainedIn were pre-rename infinitives for methods now called Contains and IsContainedIn, and the six types behind them differed only in which proper-relation Properly() set. That relation is now a constructor argument, so one type per flavour serves both directions. The dictionary results were named after their continuation member rather than their method, and the last two public types in the root namespace join the others in aweXpect.Results and aweXpect.Options.

Four ImmutableArray overloads of IsEqualTo/IsNotEqualTo returned a BeContainedIn result, which offered a Properly() that silently reinterpreted the expectation as a proper subset. They now return the plain match result like every other overload.

`Contain` and `BeContainedIn` were pre-rename infinitives for methods now called `Contains` and `IsContainedIn`, and the six types behind them differed only in which proper-relation `Properly()` set. That relation is now a constructor argument, so one type per flavour serves both directions. The dictionary results were named after their continuation member rather than their method, and the last two public types in the root namespace join the others in `aweXpect.Results` and `aweXpect.Options`.

Four `ImmutableArray` overloads of `IsEqualTo`/`IsNotEqualTo` returned a `BeContainedIn` result, which offered a `Properly()` that silently reinterpreted the expectation as a proper subset. They now return the plain match result like every other overload.
@vbreuss vbreuss self-assigned this Sep 15, 2026
@vbreuss vbreuss added the breaking change The changes require a new major version label Sep 15, 2026
@vbreuss
vbreuss merged commit d095969 into main Sep 15, 2026
10 checks passed
@vbreuss
vbreuss deleted the worktree-result-type-names branch September 15, 2026 09:05
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3 New issues

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

github-actions Bot added a commit that referenced this pull request Sep 15, 2026
…ypes after what they do (#1121) by Valentin Breuß
github-actions Bot added a commit that referenced this pull request Sep 15, 2026
…ypes after what they do (#1121) by Valentin Breuß
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 7763 2.68GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 8.0.31 (8.0.31, 8.0.3126.42015), X64 RyuJIT x86-64-v3

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

Method Mean Error StdDev Gen0 Gen1 Allocated
Bool_aweXpect 267.3 ns 3.03 ns 2.84 ns 0.0415 - 696 B
Bool_FluentAssertions 241.3 ns 0.97 ns 0.81 ns 0.0567 - 952 B
Equivalency_aweXpect 390,439.2 ns 1,525.79 ns 1,427.23 ns 32.2266 1.4648 542084 B
Equivalency_FluentAssertions 2,650,979.7 ns 12,196.66 ns 11,408.76 ns 289.0625 46.8750 4841647 B
Int_GreaterThan_aweXpect 254.7 ns 1.52 ns 1.43 ns 0.0515 - 864 B
Int_GreaterThan_FluentAssertions 243.8 ns 1.49 ns 1.24 ns 0.0730 - 1224 B
ItemsCount_AtLeast_aweXpect 463.2 ns 3.35 ns 2.97 ns 0.0811 - 1360 B
ItemsCount_AtLeast_FluentAssertions 480.8 ns 1.61 ns 1.43 ns 0.1197 - 2008 B
String_aweXpect 443.9 ns 3.59 ns 3.36 ns 0.0672 - 1128 B
String_FluentAssertions 1,183.7 ns 8.39 ns 7.44 ns 0.2346 - 3944 B
StringArray_aweXpect 1,846.9 ns 8.06 ns 7.54 ns 0.1564 - 2624 B
StringArray_FluentAssertions 1,282.5 ns 15.04 ns 14.07 ns 0.2480 - 4152 B
StringArrayInAnyOrder_aweXpect 2,445.7 ns 12.89 ns 12.05 ns 0.1678 - 2816 B
StringArrayInAnyOrder_FluentAssertions 26,761.1 ns 62.18 ns 58.16 ns 1.9836 0.0610 33471 B

@github-actions

Copy link
Copy Markdown
Contributor

👽 Mutation Results

Mutation testing badge

aweXpect

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Runtime Errors Total Detected Total Undetected Total Mutants
Options/EnumerableQuantifier.All.cs 100.00% 25 0 0 0 7 13 0 25 0 45
Options/EnumerableQuantifier.AtLeast.cs 96.15% 25 0 0 1 8 12 0 25 1 46
Options/EnumerableQuantifier.AtMost.cs 100.00% 22 0 0 0 8 13 0 22 0 43
Options/EnumerableQuantifier.Between.cs 97.14% 33 1 1 0 12 21 0 34 1 68
Options/EnumerableQuantifier.Exactly.cs 97.30% 36 1 0 0 14 22 0 36 1 73
Options/EnumerableQuantifier.LessThan.cs 100.00% 21 0 1 0 8 13 0 22 0 43
Options/EnumerableQuantifier.MoreThan.cs 100.00% 26 0 0 0 7 12 0 26 0 45
Options/EnumerableQuantifier.None.cs 92.31% 23 0 1 2 6 9 0 24 2 41
Results/ContainsKeyResult.cs 100.00% 3 0 0 0 0 0 0 3 0 3
Results/ContainsKeysResult.cs 75.00% 3 1 0 0 0 1 0 3 1 5
Results/ObjectProperCollectionMatchResult.cs 100.00% 1 0 0 0 1 0 0 1 0 2
Results/ProperCollectionMatchResult.cs 100.00% 1 0 0 0 1 0 0 1 0 2
Results/StringProperCollectionMatchResult.cs 100.00% 1 0 0 0 1 0 0 1 0 2
That/Collections/CollectionHelpers.cs 92.78% 89 5 1 2 29 40 0 90 7 166
That/Collections/ThatAsyncEnumerable.Contains.cs 81.91% 152 24 2 10 54 40 0 154 34 282
That/Collections/ThatAsyncEnumerable.Elements.cs 100.00% 2 0 0 0 0 0 0 2 0 2
That/Collections/ThatAsyncEnumerable.HasCount.cs 100.00% 3 0 0 0 0 0 0 3 0 3
That/Collections/ThatAsyncEnumerable.IsContainedIn.cs 62.50% 10 6 0 0 8 0 0 10 6 24
That/Collections/ThatDictionary.ContainsKey.cs 90.91% 20 2 0 0 5 10 0 20 2 37
That/Collections/ThatDictionary.ContainsKeys.cs 83.87% 26 4 0 1 13 16 0 26 5 60
That/Collections/ThatEnumerable.Contains.cs 77.19% 264 54 0 24 99 84 0 264 78 525
That/Collections/ThatEnumerable.Elements.cs 100.00% 5 0 0 0 0 0 0 5 0 5
That/Collections/ThatEnumerable.HasCount.cs 100.00% 12 0 0 0 0 0 0 12 0 12
That/Collections/ThatEnumerable.IsContainedIn.cs 53.57% 15 13 0 0 14 0 0 15 13 42
That/Collections/ThatEnumerable.IsEqualTo.cs 100.00% 38 0 0 0 0 0 0 38 0 38
That/Collections/ThatReadOnlyDictionary.ContainsKey.cs 90.91% 20 2 0 0 5 10 0 20 2 37
That/Collections/ThatReadOnlyDictionary.ContainsKeys.cs 86.67% 26 4 0 0 13 15 0 26 4 58

The final mutation score is 85.26%

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

aweXpect.Core

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

The final mutation score is NaN%

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

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

Labels

breaking change The changes require a new major version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant