Alvecta.Foundation.ArchitectureTesting 2.1.28

There is a newer version of this package available.
See the version list below for details.
dotnet add package Alvecta.Foundation.ArchitectureTesting --version 2.1.28
                    
NuGet\Install-Package Alvecta.Foundation.ArchitectureTesting -Version 2.1.28
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Alvecta.Foundation.ArchitectureTesting" Version="2.1.28" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alvecta.Foundation.ArchitectureTesting" Version="2.1.28" />
                    
Directory.Packages.props
<PackageReference Include="Alvecta.Foundation.ArchitectureTesting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Alvecta.Foundation.ArchitectureTesting --version 2.1.28
                    
#r "nuget: Alvecta.Foundation.ArchitectureTesting, 2.1.28"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Alvecta.Foundation.ArchitectureTesting@2.1.28
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Alvecta.Foundation.ArchitectureTesting&version=2.1.28
                    
Install as a Cake Addin
#tool nuget:?package=Alvecta.Foundation.ArchitectureTesting&version=2.1.28
                    
Install as a Cake Tool

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, .UnrestrictedSourceLayers
  • BoundedContextTestsBase.SharedContexts, .UnrestrictedSourceContexts
  • TechnologyIsolationTestsBase.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

  1. Naming convention. Assemblies must be named Company.Product.<Context>.<Layer>[.<Qualifier>], and the arch-test assembly itself must be Company.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.
  2. 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 a using for it.
  • Package dependencies: xunit.v3 and Alvecta.Utils only. Mark <DevelopmentDependency>true</…>.
  • RequestValidationTests is not part of this harness — it is a solution-specific convention and stays in the consuming project (it pulls in Alvecta.Foundation.Application.Contracts).
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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