Commit Graph

9 Commits

Author SHA1 Message Date
Janis 5fab97ec10 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 10:10:09 +02:00
Janis 7b1f8b1176 fix: update main class path in build configuration and adjust VCS directory mapping
Build & Test (NowChessSystems) TeamCity build finished
2026-03-24 09:59:13 +01:00
Janis 5a21e57ca9 chore: Update build configuration for Scoverage and ScalaTest integration 2026-03-22 14:19:44 +01:00
Janis 51b210e9eb chore: Update documentation and improve test writing guidelines 2026-03-22 11:47:20 +01:00
Janis a8abd69e0e chore: Add initial implementation of move validation logic and game controller 2026-03-21 21:26:37 +01:00
Janis 1f1d3b670f chore: Refactor chess logic to MVC pattern and enhance board representation 2026-03-21 20:37:33 +01:00
Janis 9c2456e928 chore: Set up shared-models library and initial project structure for NowChessSystems 2026-03-21 17:07:28 +01:00
Janis a8d457a612 chore: Configure Scala build with dependencies and project structure 2026-03-21 15:52:51 +01:00
Janis 0d6935e184 chore: Initial Commit 2026-03-21 14:40:00 +01:00