When writing tests:
- Use descriptive names: "should [behavior] when [condition]"
- Follow Arrange-Act-Assert (AAA) pattern
- Test edge cases: null, empty, boundary values
- Mock external dependencies appropriately
- Prefer integration tests for critical paths
- Aim for 80% coverage minimum
- Use test fixtures for complex data setup
- Test error scenarios and edge cases
- Keep tests independent and isolated
- Use parameterized tests for similar scenarios
Converted and distributed by TomeVault — claim your Tome and manage your conversions.