test(domain): write failing tests for Relay aggregate

Created test suite for Relay entity covering construction, state toggling,
and explicit state control methods. Tests intentionally fail as Relay
struct is not yet implemented.

Tests cover:
- Relay::new() with id, state, and optional label
- toggle() flipping state between On/Off
- turn_on() setting state to On
- turn_off() setting state to Off

TDD phase: RED - Tests written, implementation pending (T022)

Ref: T021 (specs/001-modbus-relay-control/tasks.md)
This commit is contained in:
2026-01-03 22:53:09 +01:00
parent 3274f2a3f9
commit 72eafd285b
3 changed files with 66 additions and 1 deletions

View File

@@ -231,7 +231,7 @@
- **File**: src/domain/relay.rs
- **Complexity**: Low | **Uncertainty**: Low
- [ ] **T021** [US1] [TDD] Write tests for Relay aggregate
- [x] **T021** [US1] [TDD] Write tests for Relay aggregate
- Test: Relay::new(RelayId(1), RelayState::Off, None) creates relay
- Test: relay.toggle() flips state
- Test: relay.turn_on() sets state to On