Create ChatAgent.Api.Tests and ChatAgent.Client.Tests projects with xUnit and Moq. Test HealthController (200 + valid response), ChatController (SSE streaming with mocked upstream, error handling), and ChatApiClient (delta parsing, error events, health endpoint). 6 tests, all passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.0 KiB
1.0 KiB
Why
The project has zero test coverage. There are two controllers, a typed HttpClient service, and shared models — all untested. Adding tests now establishes the pattern before the codebase grows, and catches regressions as new phases are added.
What Changes
- Create an xUnit test project for the API (
ChatAgent.Api.Tests) - Create an xUnit test project for the Client services (
ChatAgent.Client.Tests) - Add tests for HealthController (GET /api/health)
- Add tests for ChatController (POST /api/chat SSE streaming proxy)
- Add tests for ChatApiClient (GetHealthAsync, SendChatStreamingAsync)
- Add both test projects to the solution
Capabilities
New Capabilities
test-infrastructure: Test project setup, test framework choices, and shared test utilities
Modified Capabilities
Impact
tests/ChatAgent.Api.Tests/: New xUnit test projecttests/ChatAgent.Client.Tests/: New xUnit test projectChatAgent.sln: Add test projects