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() - { - - } -}