Home → Documentation → Contributing → Testing
Testing should mirror the architecture.
Foundation
↓
Generator
↓
Runtime
↓
SQL
↓
Transport
Every layer has its own responsibilities and should be tested independently.
Avoid relying solely on end-to-end integration tests.
End-to-End
Integration Tests
Snapshot Tests
Unit Tests
The majority of tests should be unit tests.
Integration tests validate interactions between components.
Snapshot tests validate generated code.
The Generator requires the largest test surface.
Recommended categories:
Parser Tests
↓
Validation Tests
↓
Relationship Tests
↓
Identifier Allocation Tests
↓
Metadata Generation Tests
↓
Snapshot Tests
Each stage should be tested independently.
Parser tests verify discovery of application models.
Example scenarios:
Parser tests should isolate Roslyn analysis from code generation.
Runtime tests verify execution behavior independently of SQL.
Examples:
Runtime tests should replace external dependencies with test doubles where practical.
Because Native AOT is a core design goal, compatibility should be validated regularly.
Recommended checks:
No runtime reflection should be introduced.
Every pull request should execute:
Builds should fail if generated snapshots change unexpectedly.
| ← Previous: Code Style | Next: ADR Process → |