# Test Unit Suite

> Run unit tests for the API Service and Analyzers. Use this to verify business logic, individual components, and code analyzers.

- Skill: `majiayu000/test-unit-suite` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add majiayu000/test-unit-suite`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/test-unit-suite/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/test-unit-suite

---


To verify the logic, endpoints, and custom analyzers of the API Service:

1. **Run Service Unit Tests**
   - Navigate to `tests/ApiService/BookStore.ApiService.UnitTests`.
   - Run: `dotnet test`
   - **Purpose**: Verifies handlers, validation, and domain logic.

2. **Run Analyzer Unit Tests**
   - Navigate to `tests/ApiService/BookStore.ApiService.Analyzers.UnitTests`.
   - Run: `dotnet test`
   - **Purpose**: Verifies custom Roslyn analyzers (e.g., UUIDv7 enforcement).

// turbo
3. **Both (shortcut)**
   - To run both test suites in one command:
     ```bash
     dotnet test tests/ApiService/BookStore.ApiService.UnitTests/BookStore.ApiService.UnitTests.csproj && \
     dotnet test tests/ApiService/BookStore.ApiService.Analyzers.UnitTests/BookStore.ApiService.Analyzers.UnitTests.csproj
     ```

4. **Analyze Results**
   - **Pass**: Core logic and static analysis rules are correct.
   - **Fail**:
     - Check the specific failing test and project.
     - Analyzer tests often fail if code samples in tests don't match expected diagnostics.

## Related Skills

**Used By**:
- `/test__verify_feature` - Runs all tests including these unit tests

**Related**:
- `/test__integration_suite` - Run full integration test suite
- `/test__verify_feature` - Complete verification (build + format + all tests)

**See Also**:
- [testing-guide](../../../docs/guides/testing-guide.md) - TUnit testing patterns
- ApiService.UnitTests AGENTS.md - Unit test patterns
- Analyzers.UnitTests AGENTS.md - Analyzer testing patterns

