43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using AcDream.Core.Combat;
|
|
|
|
namespace AcDream.Core.Tests.Combat;
|
|
|
|
public sealed class CombatInputPlannerTests
|
|
{
|
|
[Fact]
|
|
public void ToggleMode_FromNonCombat_UsesDefaultCombatMode()
|
|
{
|
|
Assert.Equal(CombatMode.Melee, CombatInputPlanner.ToggleMode(CombatMode.NonCombat));
|
|
Assert.Equal(
|
|
CombatMode.Missile,
|
|
CombatInputPlanner.ToggleMode(CombatMode.NonCombat, CombatMode.Missile));
|
|
}
|
|
|
|
[Fact]
|
|
public void ToggleMode_FromCombat_ReturnsNonCombat()
|
|
{
|
|
Assert.Equal(CombatMode.NonCombat, CombatInputPlanner.ToggleMode(CombatMode.Melee));
|
|
Assert.Equal(CombatMode.NonCombat, CombatInputPlanner.ToggleMode(CombatMode.Magic));
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(CombatAttackAction.Low, AttackHeight.Low)]
|
|
[InlineData(CombatAttackAction.Medium, AttackHeight.Medium)]
|
|
[InlineData(CombatAttackAction.High, AttackHeight.High)]
|
|
public void HeightFor_MapsRetailAttackKeys(CombatAttackAction action, AttackHeight expected)
|
|
{
|
|
Assert.Equal(expected, CombatInputPlanner.HeightFor(action));
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(CombatMode.Melee, true)]
|
|
[InlineData(CombatMode.Missile, true)]
|
|
[InlineData(CombatMode.NonCombat, false)]
|
|
[InlineData(CombatMode.Magic, false)]
|
|
public void SupportsTargetedAttack_MatchesRetailExecuteAttackModes(
|
|
CombatMode mode,
|
|
bool expected)
|
|
{
|
|
Assert.Equal(expected, CombatInputPlanner.SupportsTargetedAttack(mode));
|
|
}
|
|
}
|