Skip to content

Test box rolls, mall delivery, potion cooldown and fairy bead services - #3983

Merged
erwan-joly merged 2 commits into
masterfrom
tests/gameobject-services
Dec 1, 2026
Merged

erwan-joly merged 2 commits into
masterfrom
tests/gameobject-services

Conversation

@erwan-joly

Copy link
Copy Markdown
Collaborator

Adds service-level tests for four NosCore.GameObject services that had no test class of their own. They were only reached through the handlers that call them, so several branches were never run.

  • BoxRollService (8 tests): rows outside the box's rare range, design or with no chance are left out. The roll lands in the set its weight points at. A set gives all its lines, ordered by item. A class box keeps only the sets that fit the opener's gender, and an ordinary box keeps every set.
  • MallDeliveryService (5 tests): pending items go out oldest purchase first, with one thanks message each. Another character's items and already-delivered items are left alone. When a mail fails, the item stays pending and no thanks message is sent, and the next sync delivers it.
  • PotionCooldownService (4 tests): the 300 ms default on a map with no type. A map with two types uses the longer delay. A delay set on another map's type is ignored. A delay shorter than the default applies.
  • FairyBeadService (8 tests): storing a fairy keeps its level and the character it is bound to. Storing is refused while running a shop, from a pocket other than equipment, and into a specialist holder. IsFairyBead is checked for both kinds of holder. Taking a fairy out leaves the bead unchanged. Taking one out of an empty bead throws.

No production code changed; none of the tests found a bug.

None of these overlap with the areas other open PRs are testing (item handlers, mate control, partner specialists, login, group, family, bazaar, bin, friends, notes, master registry, hub clients, upgrades, trades).

Test results

dotnet test test/NosCore.GameObject.Tests: 3660 passed, 0 failed, 0 skipped (25 of them new).

These tests only check the services' logic. They do not verify any gameplay behaviour in a client.


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5437525 and 1863f2c.

Files selected for processing: 4

  • test/NosCore.GameObject.Tests/Services/BoxService/BoxRollServiceTests.cs
  • test/NosCore.GameObject.Tests/Services/FairyBeadService/FairyBeadServiceTests.cs
  • test/NosCore.GameObject.Tests/Services/MallService/MallDeliveryServiceTests.cs
  • test/NosCore.GameObject.Tests/Services/PotionService/PotionCooldownServiceTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copy link
Copy Markdown
Collaborator Author

Review: MERGE-WITH-NOTE

Tests only. Checked against test/README.md: services are built with World.Create<T>(), mocks frozen on the world, no packet text.

Fixed (81e191f): BoxRollServiceTests built ItemGenerationService by hand with new ItemCatalog(...), NullLoggerFactory, new RarityPointService() and new RandomProvider(); it now uses World.Create<ItemGenerationService>() against the catalog already injected. The 25 new tests pass locally.

Left: nothing blocking.

Screenshots: not applicable (no client-visible change).

🤖 Generated with Claude Code


Generated by Claude Code

@erwan-joly
erwan-joly force-pushed the tests/gameobject-services branch from 81e191f to 1863f2c Compare December 1, 2026 16:47
@erwan-joly
erwan-joly merged commit 6f61ba3 into master Dec 1, 2026
7 checks passed
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.

2 participants