Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.

feat: add extension method filter and assertions - #303

Merged
vbreuss merged 1 commit into
mainfrom
feature/237-extension-method-filter-assertion
Jun 4, 2026
Merged

vbreuss merged 1 commit into
mainfrom
feature/237-extension-method-filter-assertion

Conversation

@vbreuss

@vbreuss vbreuss commented Jun 4, 2026

Copy link
Copy Markdown
Member

Add first-class support for identifying extension methods, mirroring the existing async feature:

  • Filter: WhichAreExtensionMethods() / WhichAreNotExtensionMethods()
  • Single assert: IsAnExtensionMethod() / IsNotAnExtensionMethod()
  • Plural assert: AreExtensionMethods() / AreNotExtensionMethods() (including IAsyncEnumerable overloads on net8.0+)

Detection is based on the compiler-emitted ExtensionAttribute via a new MethodInfoHelpers.IsExtensionMethod() helper. Updates the README methods table and the public API approval files, and adds full test coverage (including negated cases and exact failure-message assertions).


Add first-class support for identifying extension methods, mirroring the
existing async feature:

- Filter: WhichAreExtensionMethods() / WhichAreNotExtensionMethods()
- Single assert: IsAnExtensionMethod() / IsNotAnExtensionMethod()
- Plural assert: AreExtensionMethods() / AreNotExtensionMethods()
  (including IAsyncEnumerable overloads on net8.0+)

Detection is based on the compiler-emitted ExtensionAttribute via a new
MethodInfoHelpers.IsExtensionMethod() helper. Updates the README methods
table and the public API approval files, and adds full test coverage
(including negated cases and exact failure-message assertions).
@vbreuss vbreuss self-assigned this Jun 4, 2026
@vbreuss vbreuss added the enhancement New feature or request label Jun 4, 2026
@vbreuss
vbreuss enabled auto-merge (squash) June 4, 2026 07:51
@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Test Results

    13 files  ±  0      13 suites  ±0   6m 32s ⏱️ -18s
 5 610 tests + 26   5 607 ✅ + 26   3 💤 ±0  0 ❌ ±0 
33 640 runs  +156  33 627 ✅ +156  13 💤 ±0  0 ❌ ±0 

Results for commit 32eae02. ± Comparison against base commit 4e00785.

@vbreuss
vbreuss merged commit 1576e49 into main Jun 4, 2026
11 checks passed
@vbreuss
vbreuss deleted the feature/237-extension-method-filter-assertion branch June 4, 2026 07:54
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 2.83GHz, 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 227.4 ns 3.16 ns 2.96 ns 0.0386 648 B

@github-actions

github-actions Bot commented Jun 4, 2026

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
Filters/MethodFilters.WhichAreExtensionMethods.cs 100.00% 3 0 0 0 0 0 3 0 3
Helpers/MethodInfoHelpers.cs 97.44% 38 1 0 0 12 2 38 1 53
ThatMethod.IsAnExtensionMethod.cs 100.00% 10 0 0 0 3 6 10 0 19
ThatMethods.AreExtensionMethods.cs 100.00% 18 0 0 0 4 12 18 0 34

The final mutation score is 98.57%

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

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

This is addressed in release v2.0.0.

@github-actions github-actions Bot added the state: released The issue is released label Jun 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

WhichAreExtensionMethods() filter and assertion for methods

1 participant