Cycles, boundaries, naming, and placement rules
Architecture testing for .NET
ArchUnit.NET
Analyze C# projects and express boundaries as fluent, testable rules. The alpha includes cycles, dependency policies, naming, presets, baselines, and SARIF or HTML reporting for xUnit, NUnit, MSTest, and framework-neutral use.
NuGet
dotnet add package ArchUnit --version 2.4.0-alpha.2using ArchUnitNet;
using ArchUnitNet.Testing.XUnit;
[Fact]
public async Task DomainStaysIndependent()
{
var rule = ArchUnit.ProjectFiles("./App.csproj")
.InPath("src/Domain/**")
.ShouldNot()
.DependOnFiles()
.InPath("src/Infrastructure/**");
await rule.PassesAsync();
}Capabilities
What ArchUnit.NET brings to the test suite.
The family shares a recognizable architecture vocabulary while each implementation stays honest about its language, toolchain, and maturity.
xUnit, NUnit, and MSTest adapters
Architecture presets and gradual-adoption baselines
SARIF, JSON, text, and HTML reports
Structured violations for custom assertions
Async and framework-neutral execution
Current maturity
Alpha preview
An evaluation-only alpha under active development. APIs and behavior can still change before a stable release.
Where it fits
Put boundaries next to the code they protect.
Common starting points for ArchUnit.NET include the following project shapes.
More ecosystems
The same intent, expressed natively.
Explore sibling implementations and carry the architecture vocabulary across a polyglot system.
Make the first boundary executable.
Add one meaningful rule, run it with the existing tests, and grow the architecture suite as the system reveals where it needs protection.
Start with ArchUnit.NET ↗