Skip to content

[Quartermaster] Tech Debt: Split LevelUpApplicationServiceTests.cs (1055 lines) #2702

Description

@LordOfMyatar

Summary

Quartermaster/Quartermaster.Tests/LevelUpApplicationServiceTests.cs is 1055 lines, past the 1000-line threshold that requires a tracking issue.

Detail

The file covers the whole of LevelUpApplicationService in one class: class-level application, skills, spells, hit points, ability increases, skill-point calculation, the consolidated multi-level helpers, saving throws, and CE-mode extras.

It crossed the threshold in #2676, which added four tests for ApplyOverflowAbilityIncreases.

Suggested split

Group by the concern under test, mirroring the service's own regions:

  • LevelUpApplicationServiceTests.Application.cs — ApplyClassLevel, ApplyFeats, ApplySkills, ApplySpells, ApplyHitPoints, ApplyAbilityIncrease
  • LevelUpApplicationServiceTests.Calculations.cs — CalculateHpIncrease, CalculateConRetroactiveHp, skill points, max ranks
  • LevelUpApplicationServiceTests.Consolidated.cs — GetAbilityIncreaseLevels, CalculateConsolidatedHp, ApplyOverflowAbilityIncreases
  • LevelUpApplicationServiceTests.SavingThrows.cs — UpdateSavingThrows

Partial classes keep the shared fixture and CreatureBuilder usage intact, matching the convention already used across the Quartermaster source.

Acceptance

  • No file over 1000 lines.
  • Test count unchanged, all passing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    quartermasterCreature Editor / Quartermaster tooltech-debtTechnical debt and code quality improvements

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions