Skip to content

fix: call code of the caller through UserCode and validate arguments like core - #386

Merged
vbreuss merged 1 commit into
mainfrom
fix/user-code-and-arguments
Oct 10, 2026
Merged

vbreuss merged 1 commit into
mainfrom
fix/user-code-and-arguments

Conversation

@vbreuss

@vbreuss vbreuss commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

throwing predicate, name selector, Contains* filter or custom dependency resolver aborted the evaluation instead of failing the expectation (and its negation), missing arguments surfaced as NullReferenceExceptions, argument exceptions bypassed the trace writer and used wording that differs from aweXpect.Core, and ContainsMethods ignored the cancellation of the evaluation.

…like core

A throwing predicate, name selector, Contains* filter or custom dependency resolver aborted the evaluation instead of failing the expectation (and its negation), missing arguments surfaced as NullReferenceExceptions, argument exceptions bypassed the trace writer and used wording that differs from aweXpect.Core, and ContainsMethods ignored the cancellation of the evaluation.
@vbreuss vbreuss self-assigned this Oct 10, 2026
Copilot AI balanced review requested due to automatic review settings October 10, 2026 08:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vbreuss vbreuss changed the title fix: call code of the caller through UserCode and validate arguments … fix: call code of the caller through UserCode and validate arguments like core Oct 10, 2026
@vbreuss
vbreuss enabled auto-merge (squash) October 10, 2026 08:12
@sonarqubecloud

Copy link
Copy Markdown

@vbreuss
vbreuss disabled auto-merge October 10, 2026 08:51
@vbreuss
vbreuss merged commit 3b33b91 into main Oct 10, 2026
14 checks passed
@vbreuss
vbreuss deleted the fix/user-code-and-arguments branch October 10, 2026 08:51
@github-actions

Copy link
Copy Markdown

👽 Mutation Results

Mutation testing badge

aweXpect.Reflection

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Runtime Errors Total Detected Total Undetected Total Mutants
Filters/TypeFilters.cs 91.43% 32 3 0 0 17 0 0 32 3 52
Helpers/AtIndexMatch.cs 100.00% 22 0 0 0 4 0 0 22 0 26
Helpers/ThrowHelper.cs 100.00% 3 0 0 0 2 0 0 3 0 5
Helpers/TypeHelpers.cs 77.01% 479 82 0 61 201 64 0 479 143 887
Options/AttributeFilterOptions.cs 100.00% 37 0 0 0 13 8 0 37 0 58
Options/NamespaceDependencyOptions.cs 100.00% 34 0 0 0 10 2 0 34 0 46
Options/TypeDependencyOptions.cs 71.43% 5 2 0 0 2 0 0 5 2 9
Options/TypeSetDependencyOptions.cs 84.00% 21 4 0 0 9 3 0 21 4 37
ThatAssemblies.HaveName.cs 84.62% 22 1 0 3 5 25 0 22 4 56
ThatAssemblies.HaveVersion.cs 96.67% 58 1 0 1 15 25 0 58 2 100
ThatAssembly.HasVersion.cs 100.00% 68 0 0 0 16 33 0 68 0 117
ThatMembers.HaveName.cs 88.46% 23 3 0 0 5 25 0 23 3 56
ThatType.ContainsMethods.cs 94.44% 17 1 0 0 2 10 0 17 1 30

The final mutation score is 83.52%

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

@github-actions

Copy link
Copy Markdown

🚀 Benchmark Results

Details

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

Method Mean Error StdDev Gen0 Allocated
TypeIsNotStatic_aweXpect 137.2 ns 0.79 ns 0.66 ns 0.0248 416 B

vbreuss added a commit that referenced this pull request Oct 10, 2026
…rough UserCode (#387)

* fix: call code of the caller through UserCode and validate arguments like core (#386)

 throwing predicate, name selector, Contains* filter or custom dependency resolver aborted the evaluation instead of failing the expectation (and its negation), missing arguments surfaced as NullReferenceExceptions, argument exceptions bypassed the trace writer and used wording that differs from aweXpect.Core, and ContainsMethods ignored the cancellation of the evaluation.

* fix: follow the message conventions for names, negations and type relations

A negated namespace or dependency expectation was negated twice ("does not have namespace not equal to …"), so it read as the opposite of what was checked; a mismatching name, namespace or target framework was reported as "it was …" without naming the member; and the type-relation results repeated the expectation while their Actual context bypassed the formatting settings.

* fix: call the remaining predicates of the caller through UserCode

When a Which, Except, WithVersion or attribute predicate of a filter, or a predicate added to the parameter or generic argument filter options, threw during the evaluation, the failure did not name the predicate as the code that threw.
@github-actions

Copy link
Copy Markdown

This is addressed in release v3.0.0.

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

Labels

state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants