Add unit tests for AddCommand and HelpCommand - #11
Merged
Conversation
The only two command classes with zero test coverage. Characterizes the current uncaught IllegalArgumentException thrown by AddCommand when invoked with no arguments (see #10) rather than fixing it, per the test-expansion cycle's characterization-only scope. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric:
Repo-specific rubric:
Summary: two new test files add coverage for the previously-untested This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AddCommandandHelpCommand, the only two command classes previously left without test coverage (EditCommand,RemoveCommand, andDefaultCommandalready had tests).EditCommandTest/RemoveCommandTestare followed: item/inventory/meta are mocked, lore mutation is verified viasetLore, and rejection paths are asserted to returnfalse.AddCommand.execute(CommandSender, String[])has noargs.length == 0guard (unlike itsEditCommand/RemoveCommandsiblings), so an uncaughtIllegalArgumentExceptionis thrown instead of a graceful usage message when/pl addis invoked with no arguments. This is tracked separately in AddCommand throws uncaught exception instead of usage message when args are missing #10, filed alongside this PR, and left for a future implementation cycle rather than being fixed here.Test plan
mvn test— all 19 tests pass (12 pre-existing + 7 new, acrossAddCommandTestandHelpCommandTest)No tracking issue is closed by this PR — the cycle's backlog consisted of no open issues, so this cycle's work was selected from Phase 2's Stage B (unit-test expansion) rather than issue implementation. #10 was filed as a followup and is left open for a future cycle.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).