Commit 185991d
Add comprehensive nitrogen model test suite
Implemented 12 test cases covering all nitrogen model functionality:
**Basic Tests (6):**
- Initialization: Verifies pools initialized correctly and output data written
- Application and Pool Splitting: Verifies N splits 15%/85% to root/available
- Rate Limiting: Verifies accumulation limited by max_N_accumulation_rate
- Stress Factor Output: Verifies stress factor exists and is in [0,1]
- Remobilization: Verifies remobilization runs without crashes under stress
- Fruit Removal: Verifies nitrogen consumed during fruit growth
**Integration Test (1):**
- Full Growth Cycle: Complete simulation with periodic N applications
**Edge Cases (4):**
- Zero Nitrogen: Verifies no crash with 0 N, stress factor low
- Excessive Nitrogen: Verifies stress factor approaches 1.0, clamps correctly
- No Leaves: Verifies no crash with plant having no leaves
- Division by Zero Prevention: Verifies bug fixes prevent crashes
**Model Control (1):**
- Enable/Disable: Verifies nitrogen model toggle functionality
All 12 tests pass with 196 assertions. Tests verify both functionality
and the critical bug fixes (fruit scale factor tracking and division by
zero prevention).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 6c5625d commit 185991d
1 file changed
Lines changed: 426 additions & 0 deletions
0 commit comments