test(domain): write failing tests for RelayId newtype validation

Tests cover validation requirements for the RelayId newtype:
- Valid relay IDs (1-8 for 8-channel controller)
- Invalid IDs outside valid range
- Smart constructor error handling
- Type-safe ID representation

TDD red phase: Tests fail until RelayId is implemented.

Ref: T017 (specs/001-modbus-relay-control/tasks.md)
This commit is contained in:
2026-01-03 22:15:28 +01:00
parent c427007907
commit 86b194ad74
2 changed files with 43 additions and 1 deletions

View File

@@ -202,7 +202,7 @@
**⚠️ TDD CRITICAL**: Write failing tests FIRST for every type, then implement
- [ ] **T017** [US1] [TDD] Write tests for RelayId newtype
- [x] **T017** [US1] [TDD] Write tests for RelayId newtype
- Test: RelayId::new(1) → Ok(RelayId(1))
- Test: RelayId::new(8) → Ok(RelayId(8))
- Test: RelayId::new(0) → Err(InvalidRelayId)