Conversation
Introduce a comprehensive suite of unit tests under ComputerSolitaireTests. Adds tests for AutoFinishPlanner, AutoMoveAdvisor, HintAdvisor, MoveEvaluationRanking, GameRules, Scoring, SavedGamePayload sanitization, GamePersistenceStore (using an in-memory SwiftData context), GameStatisticsStore, and core SolitaireViewModel behaviors (drawing, recycling, drag/drop, undo, pause/resume, and auto-finish). Also includes TestSupport helpers (TestCards, GameStateFixtures, DateFixtures, and test assertions) to build deterministic board states and fixtures for the tests.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5cec84552
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Introduce a DateProviding protocol with SystemDateProvider and TestDateProvider, and inject it into SolitaireViewModel so all time reads use dateProvider.now. Add sanitizedForRestore(at:) to SavedGamePayload and thread an explicit now through GamePersistence.load/save to make persistence timestamp sanitization deterministic. Update SavedGameRecord insertion/updatedAt to use the provided now. Adjust unit tests to use TestDateProvider and update time-based assertions accordingly.
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Introduce a comprehensive suite of unit tests under ComputerSolitaireTests. Adds tests for AutoFinishPlanner, AutoMoveAdvisor, HintAdvisor, MoveEvaluationRanking, GameRules, Scoring, SavedGamePayload sanitization, GamePersistenceStore (using an in-memory SwiftData context), GameStatisticsStore, and core SolitaireViewModel behaviors (drawing, recycling, drag/drop, undo, pause/resume, and auto-finish). Also includes TestSupport helpers (TestCards, GameStateFixtures, DateFixtures, and test assertions) to build deterministic board states and fixtures for the tests.