Alvecta.Foundation.ArchitectureTesting
4.1.37
dotnet add package Alvecta.Foundation.ArchitectureTesting --version 4.1.37
NuGet\Install-Package Alvecta.Foundation.ArchitectureTesting -Version 4.1.37
<PackageReference Include="Alvecta.Foundation.ArchitectureTesting" Version="4.1.37" />
<PackageVersion Include="Alvecta.Foundation.ArchitectureTesting" Version="4.1.37" />
<PackageReference Include="Alvecta.Foundation.ArchitectureTesting" />
paket add Alvecta.Foundation.ArchitectureTesting --version 4.1.37
#r "nuget: Alvecta.Foundation.ArchitectureTesting, 4.1.37"
#:package Alvecta.Foundation.ArchitectureTesting@4.1.37
#addin nuget:?package=Alvecta.Foundation.ArchitectureTesting&version=4.1.37
#tool nuget:?package=Alvecta.Foundation.ArchitectureTesting&version=4.1.37
Universal architecture-test harness
Everything in this folder is solution-agnostic and is intended to be lifted, as-is, into a shared
NuGet package (e.g. Alvecta.Foundation.ArchitectureTesting) and reused across solutions that follow
the same Clean Architecture / bounded-context conventions. Nothing here hardcodes
Alvecta.ShopifyConnector — the product identity is derived at runtime (see below).
What lives here
| File | Role |
|---|---|
ArchitectureFixture.cs |
Mechanism: resolves the product identity, loads all product assemblies, pre-computes the transitive reference graph. |
Layer.cs |
The Clean Architecture layer taxonomy. |
AssemblyLayers.cs |
Classifies an assembly/project name into a Layer. |
LayerDependencyTestsBase.cs |
Inward-only dependency allow-table. |
BoundedContextTestsBase.cs |
A context may depend only on itself + the shared kernel. |
TechnologyIsolationTestsBase.cs |
Pure layers stay free of transport/persistence/encoding tech. |
ProjectReferenceTestsBase.cs |
csproj-level reference rules (catches declared-but-unused refs). |
The *TestsBase classes are abstract, so xunit does not run them directly. Each consuming
solution provides a thin sealed subclass (the "run-host") in its own arch-test project; xunit only
discovers tests in the test assembly, and discovery walks up into the inherited [Fact]s. See the
files in the project root (LayerDependencyTests.cs, etc.) for the pattern — typically one line each.
Policy vs. mechanism
All policy is exposed as protected virtual members with org-default values:
LayerDependencyTestsBase.AllowedReferences,.UnrestrictedSourceLayersBoundedContextTestsBase.SharedContexts,.UnrestrictedSourceContextsTechnologyIsolationTestsBase.ForbiddenTechnologyAssemblies,.AllowedFrameworkReferenceNames
A solution that follows the template overrides nothing. A solution that deviates (different tech stack, differently named shared kernel, etc.) overrides the relevant member in its run-host subclass.
Portability requirements for a consuming solution
- Naming convention. Assemblies must be named
Company.Product.<Context>.<Layer>[.<Qualifier>], and the arch-test assembly itself must beCompany.Product.ArchitectureTests. The product prefix and company prefix are derived from that name — when packaged, the package assembly (which also ends in.ArchitectureTests) is excluded and the single remaining match is the consumer's. - Assemblies must reach the output directory. The fixture scans the test bin folder for
Company.*.dll. The arch-test project must therefore reference (directly or transitively) every product assembly it wants to police — referencing the composition-root / ApiHost projects normally pulls the whole graph in. An assembly that nothing references is silently not checked.
When extracting to a package
- Rename the root namespace to the package's (e.g.
Alvecta.Foundation.ArchitectureTesting); consuming run-hosts add ausingfor it. - Package dependencies:
xunit.v3andAlvecta.Utilsonly. Mark<DevelopmentDependency>true</…>. RequestValidationTestsis not part of this harness — it is a solution-specific convention and stays in the consuming project (it pulls inAlvecta.Foundation.Application.Contracts).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Alvecta.Utils (>= 6.0.26)
- xunit.v3.assert (>= 3.2.2)
- xunit.v3.extensibility.core (>= 3.2.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.1.37 | 46 | 7/9/2026 |
| 4.0.36 | 44 | 7/9/2026 |
| 4.0.35 | 76 | 7/8/2026 |
| 3.0.34 | 84 | 7/7/2026 |
| 2.5.33 | 95 | 7/6/2026 |
| 2.5.32 | 92 | 7/4/2026 |
| 2.4.31 | 99 | 7/4/2026 |
| 2.3.30 | 97 | 7/4/2026 |
| 2.2.29 | 86 | 7/4/2026 |
| 2.1.28 | 88 | 7/4/2026 |
| 2.1.27 | 92 | 7/4/2026 |
| 2.0.26 | 95 | 7/4/2026 |
| 2.0.25 | 98 | 7/3/2026 |
| 2.0.24 | 95 | 7/3/2026 |
| 2.0.23 | 94 | 7/3/2026 |
| 2.0.22 | 107 | 7/3/2026 |
| 2.0.21 | 97 | 7/3/2026 |
| 1.0.20 | 87 | 7/1/2026 |
| 1.0.19 | 98 | 7/1/2026 |
| 1.0.18 | 99 | 7/1/2026 |