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

feat: add operator filter and assertions - #306

Merged
vbreuss merged 1 commit into
mainfrom
feat/operators-filter-assertion
Jun 4, 2026
Merged

vbreuss merged 1 commit into
mainfrom
feat/operators-filter-assertion

Conversation

@vbreuss

@vbreuss vbreuss commented Jun 4, 2026

Copy link
Copy Markdown
Member

Add first-class support for identifying operator methods (op_Addition, op_Equality, …), mirroring the existing extension-method feature:

  • Filter: WhichAreOperators() / WhichAreNotOperators()
  • Single assert: IsAnOperator() / IsNotAnOperator()
  • Plural assert: AreOperators() / AreNotOperators() (including IAsyncEnumerable overloads on net8.0+)

Detection is based on the special-name flag combined with the op_ name prefix via a new MethodInfoHelpers.IsOperator() helper (the same logic used to opt operators in through SpecialNameMembers.Operators). Updates the README methods table and the public API approval files, and adds full test coverage (including negated cases, a special-name accessor branch, and exact failure-message assertions).


Add first-class support for identifying operator methods (op_Addition,
op_Equality, …), mirroring the existing extension-method feature:

- Filter: WhichAreOperators() / WhichAreNotOperators()
- Single assert: IsAnOperator() / IsNotAnOperator()
- Plural assert: AreOperators() / AreNotOperators() (including
  IAsyncEnumerable overloads on net8.0+)

Detection is based on the special-name flag combined with the op_ name
prefix via a new MethodInfoHelpers.IsOperator() helper (the same logic
used to opt operators in through SpecialNameMembers.Operators). Updates
the README methods table and the public API approval files, and adds
full test coverage (including negated cases, a special-name accessor
branch, and exact failure-message assertions).

Closes #239
@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 09:44
@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   7m 33s ⏱️ +38s
 5 922 tests + 27   5 919 ✅ + 27   3 💤 ±0  0 ❌ ±0 
35 512 runs  +162  35 499 ✅ +162  13 💤 ±0  0 ❌ ±0 

Results for commit 1b56915. ± Comparison against base commit 7953c8e.

@vbreuss
vbreuss merged commit 2e557fd into main Jun 4, 2026
11 checks passed
@vbreuss
vbreuss deleted the feat/operators-filter-assertion branch June 4, 2026 09:49
@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.82GHz, 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 234.8 ns 2.75 ns 2.57 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.WhichAreOperators.cs 100.00% 3 0 0 0 0 0 3 0 3
Helpers/MethodInfoHelpers.cs 97.73% 43 1 0 0 12 2 43 1 58
ThatMethod.IsAnOperator.cs 100.00% 10 0 0 0 3 6 10 0 19
ThatMethods.AreOperators.cs 100.00% 18 0 0 0 4 12 18 0 34

The final mutation score is 98.67%

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.

WhichAreOperators() filter and assertion for methods

1 participant