-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Description
Create comprehensive unit tests for combat system components.
Depends on: ICombatStrategy and CombatEngine issues
Test Coverage
ICombatStrategy Tests
- Test each strategy (Melee, Magic, Ranged)
- Verify damage calculation formulas
- Test with various attack and defense values
- Test edge cases
CombatEngine Tests
- Test RunCombat() method
- Player wins scenario
- Enemy wins scenario
- Verify correct XP returned
- Verify correct Gold returned
- Test turn order (player attacks first)
Edge Cases to Cover
- Zero health
- Maximum defense (damage reduction)
- Zero attack power
- Negative values (should not occur)
Requirements
- Use xUnit testing framework
- Use seeded Random for deterministic tests
- All tests must pass in CI pipeline
- Good test naming conventions
Acceptance Criteria
- Test class for ICombatStrategy implementations
- MeleeStrategy damage calculation tested
- MagicStrategy damage calculation tested
- RangedStrategy damage calculation tested
- Test class for CombatEngine
- Player wins scenario tested
- Enemy wins scenario tested
- XP reward calculation tested
- Gold reward calculation tested
- Turn order verified
- Edge cases tested (zero health, max defense, zero attack)
- Uses seeded Random for deterministic behavior
- All tests pass in CI
- Tests follow naming conventions
Reactions are currently unavailable