Repository navigation
Add tests for the food item and event factories - #166
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Self-review rubric (scored against the diff, the local
Judgment calls for the owner:
The diff contains test code only, with green local and CI anchors. This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
|
Correction to the self-review above: the two #160 characterization tests are at This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
Summary
FoodItemFactoryTestis added: a food item is added to the square's entities, each call adds a separate entity, its appearance is written to the event log asA new food item called <name> has appeared at <x>, <y>., and it is not registered as an actor.Square#getNumActorscounts the food item, andSquare#getRandomActorthrowsActorNotFoundExceptionon a square holding only food. These two tests are expected to be updated when Food items on a square are treated as missing actors by view and by the actor actions #160 is decided.FoodItemTestis added: the name is kept, UUIDs differ between items with the same name, starting nutrition falls in[0, CONFIG.MAX_NUTRITION), andsetNutritionoverwrites it.EventFactoryTestis added: the message is kept unchanged (including null), the timestamp falls between the instants before and after creation, and each call returns a new event.LoggerTestdoes.Test plan
mvn -B clean test: 228 tests run, 0 failures, 0 errorsmvn surefire:test -Dtest='FoodItem*Test,EventFactoryTest': 14 tests run, all passingDeferred issues
tests/.No tracking issue exists for this work; the gap was found during triage (unit-test expansion).
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson