feat!: Remove EntryAssembly and ExecutingAssembly methods and refactor#331
Merged
Conversation
`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.
|
Test Results 13 files ± 0 13 suites ±0 8m 8s ⏱️ - 1m 40s Results for commit 6149761. ± Comparison against base commit 9a8b7c1. This pull request removes 6 tests. |
🚀 Benchmark ResultsDetails
|
👽 Mutation ResultsaweXpect.ReflectionDetails
The final mutation score is 87.72%Coverage Thresholds: high:80 low:60 break:0 |
|
This is addressed in release v2.0.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



feat!: remove
EntryAssembly/ExecutingAssemblysource methodsAssembly.GetExecutingAssembly()is resolved inside the library (stackcrawl mark), so
In.ExecutingAssembly()always returned theaweXpect.Reflection assembly itself - never the caller's assembly.
Assembly.GetEntryAssembly()returns the test host (ornull) undertest 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 thematching
InNamespaceResultclarifiers.Use
In.AssemblyContaining<T>()/Types.InAssemblyContaining<T>()instead, which resolve the assembly reliably from the type argument.
refactor: reuse
In.AssembliesinInNamespaceResult.InAssembliesThe clarifier inlined a byte-for-byte copy of the
In.Assembliesbody(including the description string), the only one of the clarifiers not
delegating to
In.*. Delegate to keep the description and nullhandling from drifting between
Types.InAssemblies(...)andTypes.InNamespace(...).InAssemblies(...).refactor: collapse
InNamespaceResultclarifiers into a shared helperEach clarifier repeated
<source>.Types().WithinNamespace(_namespace).The shared
Fromhelper makes the invariant structural: a futureclarifier cannot compile without re-applying the namespace filter.
docs: align the
Inclass summary with theIn/TypessplitThe summary still read
Static entry point for assemblies.althoughInalso selects types and members, and no longer covers selection bycriteria since
In.Namespacemoved toTypes.InNamespace. Mirror theREADME positioning:
Instarts from concrete reflection objects,Typesselects by criteria.style: add missing newline at end of
Types.csdocs: document the mirroring contract between
InandTypesEvery criteria-based source exists in three places (
In.*,Types.In*and the
InNamespaceResultclarifiers) that are only kept in syncmanually; note this on the
Typesclass so a new source is not addedto one surface only.