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.
This commit is contained in:
Joseph Doherty
2026-02-22 20:34:42 -05:00
parent c7fc703d7e
commit b9f4dec523
2 changed files with 43 additions and 16 deletions

View File

@@ -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 <path/to/TestProject.csproj>
# 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

View File

@@ -1,10 +0,0 @@
namespace NATS.Server.Tests;
public class UnitTest1
{
[Fact]
public void Test1()
{
}
}