Skip to content

feat: add HaveName selector overload for relational name expectations#207

Merged
vbreuss merged 1 commit into
mainfrom
topic/new-withname-overload
May 28, 2026
Merged

feat: add HaveName selector overload for relational name expectations#207
vbreuss merged 1 commit into
mainfrom
topic/new-withname-overload

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented May 28, 2026

Add HaveName(Func<TMember, string>) overloads for member and assembly collections so the expected name can be derived per item (e.g. event handlers named after their event). Reuses StringEqualityOptions matching, keeps fluent option chaining, reports all violations at once, and shows per-item actual vs. expected names in failure messages.


Add `HaveName(Func<TMember, string>)` overloads for member and assembly collections so the expected name can be derived per item (e.g. event handlers named after their event). Reuses StringEqualityOptions matching, keeps fluent option chaining, reports all violations at once, and shows per-item actual vs. expected names in failure messages.
@vbreuss vbreuss self-assigned this May 28, 2026
@vbreuss vbreuss added the enhancement New feature or request label May 28, 2026
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Test Results

    13 files  ± 0      13 suites  ±0   3m 36s ⏱️ -28s
 3 101 tests +11   3 098 ✅ +11   3 💤 ±0  0 ❌ ±0 
18 586 runs  +66  18 573 ✅ +66  13 💤 ±0  0 ❌ ±0 

Results for commit 4d78671. ± Comparison against base commit a1807b6.

@github-actions
Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.300
[Host] : .NET 10.0.8 (10.0.8, 10.0.826.23019), X64 RyuJIT x86-64-v3
DefaultJob : .NET 10.0.8 (10.0.8, 10.0.826.23019), X64 RyuJIT x86-64-v3

Method Mean Error StdDev Gen0 Allocated
TypeIsNotStatic_aweXpect 222.4 ns 3.43 ns 3.04 ns 0.0386 648 B

@github-actions
Copy link
Copy Markdown

👽 Mutation Results

Mutation testing badge

aweXpect.Reflection

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants
ThatAssemblies.HaveName.cs 78.57% 22 3 0 3 6 26 22 6 60
ThatMembers.HaveName.cs 82.14% 23 2 0 3 6 26 23 5 60

The final mutation score is 80.36%

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

@vbreuss vbreuss merged commit 5d877d3 into main May 28, 2026
12 checks passed
@vbreuss vbreuss deleted the topic/new-withname-overload branch May 28, 2026 13:43
@github-actions
Copy link
Copy Markdown

This is addressed in release v1.3.0.

@github-actions github-actions Bot added the state: released The issue is released label May 28, 2026
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.

Add a HaveName(Func<TMember, string>) overload for relational (member-derived) name expectations

1 participant