test(infrastructure): write RelayLabelRepository trait tests

Add reusable test suite with 18 test functions covering get_label(),
save_label(), delete_label(), and get_all_labels() methods. Tests
verify contract compliance for any repository implementation.

Added delete_label() method to trait interface and implemented it in
MockRelayLabelRepository to support complete CRUD operations.

TDD phase: RED - Tests written before SQLite implementation (T036)

Ref: T035 (specs/001-modbus-relay-control/tasks.md)
This commit is contained in:
2026-01-11 00:59:58 +01:00
parent 306fa38935
commit 8c1d5433de
5 changed files with 468 additions and 1 deletions

View File

@@ -531,7 +531,7 @@
- **Complexity**: Medium | **Uncertainty**: High
- **Note**: Use #[ignore] attribute, run with `cargo test -- --ignored`
- [ ] **T035** [P] [US4] [TDD] Write tests for RelayLabelRepository trait
- [x] **T035** [P] [US4] [TDD] Write tests for RelayLabelRepository trait
- Test: `get_label(RelayId(1)) → Option<RelayLabel>`
- Test: `set_label(RelayId(1), label) → Result<(), RepositoryError>`
- Test: `delete_label(RelayId(1)) → Result<(), RepositoryError>`