Skip to content

feat!: Remove EntryAssembly and ExecutingAssembly methods and refactor#331

Merged
vbreuss merged 6 commits into
mainfrom
fix/types-entry-point-review-follow-up
Jun 6, 2026
Merged

feat!: Remove EntryAssembly and ExecutingAssembly methods and refactor#331
vbreuss merged 6 commits into
mainfrom
fix/types-entry-point-review-follow-up

Conversation

@vbreuss

@vbreuss vbreuss commented Jun 6, 2026

Copy link
Copy Markdown
Member
  • feat!: remove EntryAssembly/ExecutingAssembly source methods

    Assembly.GetExecutingAssembly() is resolved inside the library (stack
    crawl mark), so In.ExecutingAssembly() always returned the
    aweXpect.Reflection assembly itself - never the caller's assembly.
    Assembly.GetEntryAssembly() returns the test host (or null) under
    test runners. Both made namespace-clarified architecture assertions
    silently pass on empty collections in their primary use case.

    Removes In.EntryAssembly(), In.ExecutingAssembly(),
    Types.InEntryAssembly(), Types.InExecutingAssembly() and the
    matching InNamespaceResult clarifiers.
    Use In.AssemblyContaining<T>() / Types.InAssemblyContaining<T>()
    instead, which resolve the assembly reliably from the type argument.

  • refactor: reuse In.Assemblies in InNamespaceResult.InAssemblies

    The clarifier inlined a byte-for-byte copy of the In.Assemblies body
    (including the description string), the only one of the clarifiers not
    delegating to In.*. Delegate to keep the description and null
    handling from drifting between Types.InAssemblies(...) and
    Types.InNamespace(...).InAssemblies(...).

  • refactor: collapse InNamespaceResult clarifiers into a shared helper

    Each clarifier repeated <source>.Types().WithinNamespace(_namespace).
    The shared From helper makes the invariant structural: a future
    clarifier cannot compile without re-applying the namespace filter.

  • docs: align the In class summary with the In/Types split

    The summary still read Static entry point for assemblies. although
    In also selects types and members, and no longer covers selection by
    criteria since In.Namespace moved to Types.InNamespace. Mirror the
    README positioning: In starts from concrete reflection objects,
    Types selects by criteria.

  • style: add missing newline at end of Types.cs

  • docs: document the mirroring contract between In and Types

    Every criteria-based source exists in three places (In.*, Types.In*
    and the InNamespaceResult clarifiers) that are only kept in sync
    manually; note this on the Types class so a new source is not added
    to one surface only.

vbreuss added 6 commits June 6, 2026 04:42
`Assembly.GetExecutingAssembly()` is resolved inside the library (stack
crawl mark), so `In.ExecutingAssembly()` always returned the
aweXpect.Reflection assembly itself - never the caller's assembly.
`Assembly.GetEntryAssembly()` returns the test host (or `null`) under
test runners. Both made namespace-clarified architecture assertions
silently pass on empty collections in their primary use case.

Removes `In.EntryAssembly()`, `In.ExecutingAssembly()`,
`Types.InEntryAssembly()`, `Types.InExecutingAssembly()` and the
matching `InNamespaceResult` clarifiers.
Use `In.AssemblyContaining<T>()` / `Types.InAssemblyContaining<T>()`
instead, which resolve the assembly reliably from the type argument.
The clarifier inlined a byte-for-byte copy of the `In.Assemblies` body
(including the description string), the only one of the clarifiers not
delegating to `In.*`. Delegate to keep the description and null
handling from drifting between `Types.InAssemblies(...)` and
`Types.InNamespace(...).InAssemblies(...)`.
Each clarifier repeated `<source>.Types().WithinNamespace(_namespace)`.
The shared `From` helper makes the invariant structural: a future
clarifier cannot compile without re-applying the namespace filter.
The summary still read `Static entry point for assemblies.` although
`In` also selects types and members, and no longer covers selection by
criteria since `In.Namespace` moved to `Types.InNamespace`. Mirror the
README positioning: `In` starts from concrete reflection objects,
`Types` selects by criteria.
Every criteria-based source exists in three places (`In.*`, `Types.In*`
and the `InNamespaceResult` clarifiers) that are only kept in sync
manually; note this on the `Types` class so a new source is not added
to one surface only.
@vbreuss vbreuss enabled auto-merge (squash) June 6, 2026 02:52
@sonarqubecloud

sonarqubecloud Bot commented Jun 6, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Test Results

    13 files  ± 0      13 suites  ±0   8m 8s ⏱️ - 1m 40s
 6 400 tests  -  6   6 397 ✅  -  6   3 💤 ±0  0 ❌ ±0 
38 245 runs   - 36  38 232 ✅  - 36  13 💤 ±0  0 ❌ ±0 

Results for commit 6149761. ± Comparison against base commit 9a8b7c1.

This pull request removes 6 tests.
aweXpect.Reflection.Tests.InTests ‑ EntryAssembly_ShouldContainExpectedAssembly
aweXpect.Reflection.Tests.InTests ‑ ExecutingAssembly_ShouldContainExpectedAssembly
aweXpect.Reflection.Tests.TypesTests ‑ InEntryAssembly_ShouldUseEntryAssemblyAsSource
aweXpect.Reflection.Tests.TypesTests ‑ InExecutingAssembly_ShouldContainTypesFromExecutingAssembly
aweXpect.Reflection.Tests.TypesTests ‑ InNamespace_InEntryAssembly_ShouldUseEntryAssemblyAsSource
aweXpect.Reflection.Tests.TypesTests ‑ InNamespace_InExecutingAssembly_ShouldUseExecutingAssemblyAsSource

@vbreuss vbreuss merged commit 9a8f4d6 into main Jun 6, 2026
12 checks passed
@vbreuss vbreuss deleted the fix/types-entry-point-review-follow-up branch June 6, 2026 02:57
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.4 LTS (Noble Numbat)
AMD EPYC 7763 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 224.2 ns 1.26 ns 1.05 ns 0.0386 648 B

@github-actions

github-actions Bot commented Jun 6, 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
Collections/Filtered.Types.cs 86.84% 31 2 2 3 19 8 33 5 65
In.cs 89.47% 17 2 0 0 1 0 17 2 20

The final mutation score is 87.72%

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 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