docs: add .NET coding standards and reference from phase docs

Establish project-wide rules for testing (xUnit 3 / Shouldly /
NSubstitute), logging (Microsoft.Extensions.Logging + Serilog +
LogContext), and general C# conventions. Referenced from CLAUDE.md
and phases 4-7.
This commit is contained in:
Joseph Doherty
2026-02-26 07:27:30 -05:00
parent f7a4f56ce4
commit 8051436f57
8 changed files with 275 additions and 5 deletions

View File

@@ -50,9 +50,14 @@ dotnet run --project tools/NatsNet.PortTracker -- <command> --db porting.db
- **Phase 6: Initial Porting** - `docs/plans/phases/phase-6-porting.md`
- **Phase 7: Porting Verification** - `docs/plans/phases/phase-7-porting-verification.md`
## Naming Conventions
## .NET Standards
.NET projects use the `ZB.MOM.NatsNet.Server` prefix. Namespaces follow the `ZB.MOM.NatsNet.Server.[Module]` pattern.
All .NET code must follow the rules in [`docs/standards/dotnet-standards.md`](docs/standards/dotnet-standards.md). Key points:
- .NET 10, C# latest
- **Testing**: xUnit 3, Shouldly, NSubstitute — do NOT use FluentAssertions or Moq
- **Logging**: `Microsoft.Extensions.Logging` with Serilog provider; use `LogContext.PushProperty` for contextual enrichment
- **Naming**: PascalCase for all public members; `ZB.MOM.NatsNet.Server.[Module]` namespace hierarchy
## Reports