Skip to content

fix: format members through a package-owned wrapper instead of registering formatters for reflection types - #388

Merged
vbreuss merged 1 commit into
fix/message-conventionsfrom
fix/foreign-formatters
Oct 10, 2026
Merged

vbreuss merged 1 commit into
fix/message-conventionsfrom
fix/foreign-formatters

Conversation

@vbreuss

@vbreuss vbreuss commented Oct 10, 2026

Copy link
Copy Markdown
Member

A formatter registered for ConstructorInfo, EventInfo, FieldInfo, MethodInfo and PropertyInfo applied process-wide only after the first test that used this package, so formatting these types elsewhere depended on the test order. The messages of this package stay unchanged, and the tests now state the formatted members literally instead of relying on that global registration.

@vbreuss vbreuss self-assigned this Oct 10, 2026
@vbreuss
vbreuss added this pull request to stack #389 October 10, 2026 08:33
…ering formatters for reflection types

A formatter registered for ConstructorInfo, EventInfo, FieldInfo, MethodInfo and PropertyInfo applied process-wide only after the first test that used this package, so formatting these types elsewhere depended on the test order. The messages of this package stay unchanged, and the tests now state the formatted members literally instead of relying on that global registration.
@vbreuss
vbreuss force-pushed the fix/foreign-formatters branch from 9d45dff to 19c6a68 Compare October 10, 2026 08:51
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Test Results

    13 files  ± 0      13 suites  ±0   10m 37s ⏱️ - 2m 24s
 6 982 tests +10   6 979 ✅ +10   3 💤 ±0  0 ❌ ±0 
41 737 runs  +60  41 724 ✅ +60  13 💤 ±0  0 ❌ ±0 

Results for commit 19c6a68. ± Comparison against base commit e95263e.

@github-actions

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 9V45 3.91GHz, 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-v4
DefaultJob : .NET 10.0.12 (10.0.12, 10.0.1226.42308), X64 RyuJIT x86-64-v4

Method Mean Error StdDev Gen0 Allocated
TypeIsNotStatic_aweXpect 66.96 ns 1.302 ns 1.155 ns 0.0248 416 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 Runtime Errors Total Detected Total Undetected Total Mutants
Filters/AssemblyFilters.Except.cs 100.00% 3 0 0 0 0 0 0 3 0 3
Filters/AssemblyFilters.Which.cs 100.00% 2 0 0 0 0 0 0 2 0 2
Filters/AssemblyFilters.WithVersion.cs 100.00% 26 0 0 0 3 5 0 26 0 34
Filters/ConstructorFilters.Except.cs 100.00% 3 0 0 0 0 0 0 3 0 3
Filters/ConstructorFilters.Which.cs 100.00% 2 0 0 0 0 0 0 2 0 2
Filters/EventFilters.Except.cs 100.00% 3 0 0 0 0 0 0 3 0 3
Filters/EventFilters.Which.cs 100.00% 2 0 0 0 0 0 0 2 0 2
Filters/FieldFilters.Except.cs 100.00% 3 0 0 0 0 0 0 3 0 3
Filters/FieldFilters.Which.cs 100.00% 2 0 0 0 0 0 0 2 0 2
Filters/MethodFilters.Except.cs 100.00% 3 0 0 0 0 0 0 3 0 3
Filters/MethodFilters.Which.cs 100.00% 2 0 0 0 0 0 0 2 0 2
Filters/PropertyFilters.Except.cs 100.00% 3 0 0 0 0 0 0 3 0 3
Filters/PropertyFilters.Which.cs 100.00% 2 0 0 0 0 0 0 2 0 2
Filters/TypeFilters.Except.cs 100.00% 5 0 0 0 0 0 0 5 0 5
Filters/TypeFilters.Which.cs 100.00% 2 0 0 0 0 0 0 2 0 2
Formatting/FormattableMember.cs 84.62% 11 2 0 0 1 4 0 11 2 18
Helpers/AssemblyHelpers.cs 91.94% 57 3 0 2 12 5 0 57 5 79
Helpers/CollectionConstraintResult.cs 89.71% 61 5 0 2 24 3 0 61 7 95
Helpers/ConstructorInfoHelpers.cs 100.00% 28 0 0 0 11 2 0 28 0 41
Helpers/EventInfoHelpers.cs 100.00% 21 0 0 0 4 2 0 21 0 27
Helpers/FieldInfoHelpers.cs 97.22% 35 1 0 0 12 2 0 35 1 50
Helpers/MemberViolationRenderer.cs 100.00% 17 0 0 0 6 13 0 17 0 36
Helpers/MethodInfoHelpers.cs 80.51% 95 14 0 9 38 4 0 95 23 160
Helpers/PropertyInfoHelpers.cs 98.51% 66 1 0 0 6 4 0 66 1 77
Helpers/TypeHelpers.cs 76.89% 479 83 0 61 201 64 0 479 144 888
In.cs 89.47% 17 2 0 0 1 0 0 17 2 20
Options/GenericArgumentFilterOptions.cs 72.73% 8 0 0 3 6 2 0 8 3 19
Options/GenericArgumentsFilterOptions.cs 91.18% 31 2 0 1 13 7 0 31 3 54
Options/ParameterFilterOptions.cs 84.00% 21 3 0 1 10 4 0 21 4 39
ThatAssemblies.DependOn.cs 70.00% 7 0 0 3 0 8 0 7 3 18
ThatAssembly.HasName.cs 100.00% 5 0 0 0 1 3 0 5 0 9
ThatAssembly.Targets.cs 100.00% 5 0 0 0 1 3 0 5 0 9
ThatConstructor.Has.cs 100.00% 12 0 0 0 5 4 0 12 0 21
ThatConstructor.IsStatic.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatEvent.Has.cs 100.00% 10 0 0 0 5 4 0 10 0 19
ThatEvent.IsAbstract.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatEvent.IsNullable.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatEvent.IsSealed.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatEvent.IsStatic.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatEvent.IsVirtual.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatEvent.Overrides.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatField.Has.cs 100.00% 12 0 0 0 5 4 0 12 0 21
ThatField.IsConstant.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatField.IsNullable.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatField.IsReadOnly.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatField.IsRequired.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatField.IsStatic.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatMember.HasName.cs 100.00% 5 0 0 0 1 3 0 5 0 9
ThatMember.IsObsolete.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatMembers.HaveName.cs 88.46% 23 3 0 0 5 25 0 23 3 56
ThatMethod.Has.cs 100.00% 10 0 0 0 5 4 0 10 0 19
ThatMethod.IsAbstract.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatMethod.IsAnExtensionMethod.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatMethod.IsAnOperator.cs 100.00% 20 0 0 0 6 18 0 20 0 44
ThatMethod.IsAsync.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatMethod.IsGeneric.cs 100.00% 21 0 0 0 6 9 0 21 0 36
ThatMethod.IsSealed.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatMethod.IsStatic.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatMethod.IsVirtual.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatMethod.Overrides.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatProperty.Has.cs 100.00% 10 0 0 0 5 4 0 10 0 19
ThatProperty.HasAGetter.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.HasAnInitSetter.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.HasASetter.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.IsAbstract.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatProperty.IsAnExtensionProperty.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.IsAnIndexer.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.IsNullable.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.IsReadable.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.IsReadOnly.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.IsReadWrite.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.IsRequired.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.IsSealed.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatProperty.IsStatic.cs 100.00% 12 0 0 0 3 6 0 12 0 21
ThatProperty.IsVirtual.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.IsWritable.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.IsWriteOnly.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatProperty.Overrides.cs 100.00% 10 0 0 0 3 6 0 10 0 19
ThatType.HasNamespace.cs 100.00% 5 0 0 0 1 3 0 5 0 9
ThatType.Implements.cs 100.00% 27 0 0 0 7 8 0 27 0 42
ThatType.InheritsFrom.cs 100.00% 28 0 0 0 9 10 0 28 0 47
ThatType.IsAssignableTo.cs 100.00% 30 0 0 0 14 16 0 30 0 60

The final mutation score is 89.08%

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

@vbreuss
vbreuss merged commit 8293bdb into main Oct 10, 2026
16 checks passed
@vbreuss
vbreuss deleted the fix/foreign-formatters branch October 10, 2026 10:22
@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.

1 participant