# BenMorris/NetArchTest

A fluent API for .Net that can enforce architectural rules in unit tests.

Repository: https://github.com/BenMorris/NetArchTest
Canonical: https://ross.abutalabs.com/products/netarchtest
Language: C#
License: MIT
License Family: permissive
Last push: 2024-07-29T18:02:58+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 2837, "days_push": 765, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1772, forks 95 (observed 2026-08-28T04:05:34.147265+00:00)

## What it is
NetArchTest is a fluent API library for .NET that enforces architectural rules (naming, dependencies, class design conventions) within unit tests. Inspired by Java's ArchUnit, it lets developers write readable assertions about codebase structure that run in any test framework and CI pipeline.

## Use cases
- enforce that presentation layer does not depend on data layer in tests
- assert all service classes are sealed via unit tests
- prevent architecture violations automatically in CI builds
- write custom architectural convention tests for .NET codebases
- test that classes implementing an interface reside in specific namespaces
- create a self-testing architecture instead of relying on code review

## When to choose
- you have a .NET codebase and want architecture rules enforced as part of the test suite
- you want ArchUnit-style architecture tests in C#
- static analysis tools are too generic for your application-specific conventions

## When to avoid
- you need general-purpose static analysis or linting beyond architecture rules
- you are not on .NET Framework 4.6.1+ or .NET Core 2.0+
- you want runtime enforcement rather than test-time checks

## Facets
- artifact type: library
- maturity: stable
- function: testing, developer-tools, linter
- domain: developer-tools, testing
- platform: dotnet, cross-platform
- tags: architecture-testing, archunit-inspired, fluent-api, unit-testing, conventions, static-analysis, architecture

## Member repositories
- BenMorris/NetArchTest (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:34.147265+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:25:56.652999+00:00, confidence not recorded.
  - readme: https://github.com/BenMorris/NetArchTest (fetched 2026-08-28T04:05:34.147265+00:00, sha d9b42658d2c6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
