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

feat: add WithoutName filter and DoesNotHaveName/DoNotHaveName negated name assertions - #278

Merged
vbreuss merged 1 commit into
mainfrom
feature/without-name-and-negated-name-assertions
Jun 1, 2026
Merged

vbreuss merged 1 commit into
mainfrom
feature/without-name-and-negated-name-assertions

Conversation

@vbreuss

@vbreuss vbreuss commented Jun 1, 2026

Copy link
Copy Markdown
Member

Add the negations of the name filter and assertions across assemblies and all member kinds:

  • WithoutName: keeps items whose name does not match (Assembly, Type, Method, Property, Field, Event)
  • DoesNotHaveName: verifies a single subject is not named the given value (ThatMember generic + ThatAssembly)
  • DoNotHaveName: verifies none of the items in a collection are named the given value (ThatMembers generic + ThatAssemblies, IEnumerable and IAsyncEnumerable)

All variants accept the existing string matching options (AsPrefix, AsSuffix, AsWildcard, AsRegex, IgnoringCase). Single-subject assertions reuse the positive constraint via .Invert(); collection assertions use an inverted per-item predicate so the result reads "none have" rather than "not all have".

Includes tests with 100% line and branch coverage, regenerated public API approval files, and updated README.

…d name assertions

Add the negations of the name filter and assertions across assemblies and all member kinds:

- WithoutName: keeps items whose name does not match (Assembly, Type, Method, Property, Field, Event)
- DoesNotHaveName: verifies a single subject is not named the given value (ThatMember<TMember> generic + ThatAssembly)
- DoNotHaveName: verifies none of the items in a collection are named the given value (ThatMembers<TMember> generic + ThatAssemblies, IEnumerable and IAsyncEnumerable)

All variants accept the existing string matching options (AsPrefix, AsSuffix, AsWildcard, AsRegex, IgnoringCase). Single-subject assertions reuse the positive constraint via .Invert(); collection assertions use an inverted per-item predicate so the result reads "none have" rather than "not all have".

Includes tests with 100% line and branch coverage, regenerated public API approval files, and updated README.
@vbreuss vbreuss self-assigned this Jun 1, 2026
@vbreuss vbreuss added the enhancement New feature or request label Jun 1, 2026
@vbreuss vbreuss changed the title feat: add WithoutName filter and DoesNotHaveName/DoNotHaveName negated name assertions feat: add WithoutName filter and DoesNotHaveName/DoNotHaveName negated name assertions Jun 1, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 1, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

Test Results

    13 files  ±  0      13 suites  ±0   4m 46s ⏱️ -19s
 5 016 tests + 46   5 013 ✅ + 46   3 💤 ±0  0 ❌ ±0 
30 076 runs  +276  30 063 ✅ +276  13 💤 ±0  0 ❌ ±0 

Results for commit dd44eab. ± Comparison against base commit c2ac4c1.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 9V74 2.60GHz, 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 223.4 ns 3.45 ns 3.23 ns 0.0386 648 B

@github-actions

github-actions Bot commented Jun 1, 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/AssemblyFilters.WithoutName.cs 100.00% 2 0 0 0 1 0 2 0 3
Filters/EventFilters.WithoutName.cs 100.00% 2 0 0 0 1 0 2 0 3
Filters/FieldFilters.WithoutName.cs 100.00% 2 0 0 0 1 0 2 0 3
Filters/MethodFilters.WithoutName.cs 100.00% 2 0 0 0 1 0 2 0 3
Filters/PropertyFilters.WithoutName.cs 100.00% 2 0 0 0 1 0 2 0 3
Filters/TypeFilters.WithoutName.cs 100.00% 2 0 0 0 1 0 2 0 3
ThatAssemblies.DoNotHaveName.cs 91.67% 11 1 0 0 2 8 11 1 22
ThatAssembly.DoesNotHaveName.cs 100.00% 1 0 0 0 0 0 1 0 1
ThatMember.DoesNotHaveName.cs 100.00% 1 0 0 0 0 0 1 0 1
ThatMembers.DoNotHaveName.cs 100.00% 12 0 0 0 2 8 12 0 22

The final mutation score is 97.37%

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

@vbreuss
vbreuss merged commit d8ddb5d into main Jun 1, 2026
11 checks passed
@vbreuss
vbreuss deleted the feature/without-name-and-negated-name-assertions branch June 1, 2026 08:48
@github-actions github-actions Bot added the state: released The issue is released label Jun 3, 2026
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

This is addressed in release v1.6.0.

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.

1 participant