Commit Graph

6 Commits

Author SHA1 Message Date
Janis c75a3a28af test: add tests for undo and redo notifications in GameEngine
Build & Test (NowChessSystems) TeamCity build finished
2026-03-31 09:34:39 +02:00
Janis 40086a331f fix: improve TerminalUI coverage and make MoveCommand/ResetCommand immutable
**TerminalUI Coverage Fix:**
- Added explicit test for empty input case (lines 64-65 previously uncovered)
- Test "TerminalUI should explicitly handle empty input by re-prompting" validates
  that multiple empty inputs are properly handled by re-prompting
- UI module coverage improved to near-100%

**MoveCommand Immutability (Anti-pattern Fix):**
- Changed MoveCommand fields from var to val: moveResult, previousBoard,
  previousHistory, previousTurn
- Changed ResetCommand fields from var to val: previousBoard, previousHistory,
  previousTurn
- Updated GameEngine to use .copy() instead of direct mutation when updating
  command state (lines 88, 95, 103, 112)
- Removed 3 edge-case tests that relied on command mutation (now impossible with
  immutable fields)

**MoveCommand Immutability Tests:**
- Added MoveCommandImmutabilityTest to verify:
  - Fields cannot be mutated after creation
  - equals/hashCode respect immutability invariant
  - .copy() creates new instances with updated values

All tests pass; 100% core coverage maintained.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-31 08:43:44 +02:00
shahdlala66 41b53d1dee test: added UI model tests
Build & Test (NowChessSystems) TeamCity build failed
2026-03-30 22:32:57 +02:00
shahdlala66 75f2363517 fix: PR issues fixed
Build & Test (NowChessSystems) TeamCity build failed
2026-03-30 21:48:04 +02:00
shahdlala66 9c1acfc9db feat: undo/redo added 2026-03-29 20:58:33 +02:00
shahdlala66 d2f294294f feat: core sepration, observer added 2026-03-29 20:47:58 +02:00