Skip to content
bitzorcas
EN

Reference

Architecture tests

Architecture enforcement tests — module boundary verification, DI registration correctness, code convention checks, and dependency rule enforcement.

Last updated

BitzOrcas.Architecture.Tests enforces architectural rules that would otherwise be caught only at code review. These tests prevent structural violations from accumulating.

What it checks

RuleDescription
Module boundariesModules don’t directly reference other module internals
DI registrationAll required services are registered and resolvable
Naming conventionsEntity names follow biz_/sys_ prefix convention
Dependency directionDomain → Application → Infrastructure (never reverse)
AOT compatibilityNo reflection-heavy patterns in AOT-enabled projects

Module boundary verification

Using NetArchTest or custom reflection checks:

// Verify modules don't depend on each other's internals
var result = Types.InAssembly(moduleAssembly)
.ShouldNot()
.HaveDependencyOn(otherModuleAssembly)
.GetResult();

DI registration tests

Verify all required services can be resolved:

[Fact]
public void CoreRuntime_AllRequiredServices_ShouldBeResolvable()
{
var services = new ServiceCollection();
services.AddBitzOrcasCoreRuntime(MockConfiguration);
var provider = services.BuildServiceProvider();
provider.GetRequiredService<ICorrelationContext>();
provider.GetRequiredService<IAppClock>();
provider.GetRequiredService<IAuditLogger>();
// ... all core services
}

Running

Terminal window
dotnet test tests/BitzOrcas.Architecture.Tests