From b9f4dec5236b98931d0533eba5d9aef00ebef533 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Sun, 22 Feb 2026 20:34:42 -0500 Subject: [PATCH] docs: update CLAUDE.md with verified build and test commands Remove template UnitTest1.cs placeholder. Add actual project structure, run commands for the NATS server host, and update test command examples to reference the real project paths. --- CLAUDE.md | 49 ++++++++++++++++++++++++---- tests/NATS.Server.Tests/UnitTest1.cs | 10 ------ 2 files changed, 43 insertions(+), 16 deletions(-) delete mode 100644 tests/NATS.Server.Tests/UnitTest1.cs diff --git a/CLAUDE.md b/CLAUDE.md index 556142d..85347dd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,6 +10,8 @@ NATS is a high-performance publish-subscribe messaging system. It supports wildc ## Build & Test Commands +The solution file is `NatsDotNet.slnx`. + ```bash # Build the solution dotnet build @@ -17,19 +19,54 @@ dotnet build # Run all tests dotnet test -# Run a single test project -dotnet test - -# Run a specific test by name -dotnet test --filter "FullyQualifiedName~TestClassName.TestMethodName" - # Run tests with verbose output dotnet test -v normal +# Run a single test project +dotnet test tests/NATS.Server.Tests + +# Run a specific test by name +dotnet test tests/NATS.Server.Tests --filter "FullyQualifiedName~TestName" + +# Run the NATS server (default port 4222) +dotnet run --project src/NATS.Server.Host + +# Run the NATS server on a custom port +dotnet run --project src/NATS.Server.Host -- -p 14222 + # Clean and rebuild dotnet clean && dotnet build ``` +## .NET Project Structure + +``` +NatsDotNet.slnx # Solution file +src/ + NATS.Server/ # Core server library + NatsServer.cs # Server: listener, accept loop, shutdown + NatsClient.cs # Per-connection client: read/write loops, sub tracking + NatsOptions.cs # Server configuration (port, host, etc.) + Protocol/ + NatsParser.cs # Protocol state machine (PUB, SUB, UNSUB, etc.) + NatsProtocol.cs # Wire-level protocol writing (INFO, MSG, PING/PONG) + Subscriptions/ + SubjectMatch.cs # Subject validation and wildcard matching + SubList.cs # Trie-based subscription list with caching + SubListResult.cs # Match result container (plain subs + queue groups) + Subscription.cs # Subscription model (subject, sid, queue, client) + NATS.Server.Host/ # Executable host app + Program.cs # Entry point, CLI arg parsing (-p port) +tests/ + NATS.Server.Tests/ # xUnit test project + ParserTests.cs # Protocol parser tests + SubjectMatchTests.cs # Subject validation & matching tests + SubListTests.cs # Subscription list trie tests + ClientTests.cs # Client-level protocol tests + ServerTests.cs # Server pubsub/wildcard tests + IntegrationTests.cs # End-to-end tests using NATS.Client.Core NuGet +``` + ## Go Reference Commands ```bash diff --git a/tests/NATS.Server.Tests/UnitTest1.cs b/tests/NATS.Server.Tests/UnitTest1.cs deleted file mode 100644 index 4f03e94..0000000 --- a/tests/NATS.Server.Tests/UnitTest1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace NATS.Server.Tests; - -public class UnitTest1 -{ - [Fact] - public void Test1() - { - - } -}