Skip to content

Add comprehensive unit tests#20

Merged
austin-smith merged 4 commits intomainfrom
unit-tests
Feb 23, 2026
Merged

Add comprehensive unit tests#20
austin-smith merged 4 commits intomainfrom
unit-tests

Conversation

@austin-smith
Copy link
Copy Markdown
Owner

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.

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.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread ComputerSolitaireTests/SolitaireViewModelCoreTests.swift Outdated
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.
@austin-smith
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ 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".

@austin-smith austin-smith merged commit f4dfee6 into main Feb 23, 2026
2 checks passed
@austin-smith austin-smith deleted the unit-tests branch February 23, 2026 09:13
@austin-smith austin-smith linked an issue Feb 23, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add comprehensive unit tests

1 participant