acdream/tests/AcDream.App.Tests/UI/Layout/SpellcastingShortcutInputTests.cs
Erik f6fe0f2a4f
All checks were successful
CI / linux-portable (push) Successful in 3m27s
CI / windows-gate (push) Successful in 6m42s
CI / release (push) Successful in 2m12s
fix(client): restore retail interaction parity
Harden keyboard and camera routing, inventory and vendor interactions, chat/emotes, relog portal flow, and paperdoll rendering. Add retail research, connected gate coverage, and release-gate validation.
2026-08-26 20:45:11 +02:00

47 lines
1.5 KiB
C#

using AcDream.App.UI.Layout;
using AcDream.UI.Abstractions.Input;
namespace AcDream.App.Tests.UI.Layout;
public sealed class SpellcastingShortcutInputTests
{
[Fact]
public void EveryRetailFavoriteSpellSlotHasALiveConsumer()
{
InputAction[] slots = RetailActionIdentityTable.Map
.Where(entry => entry.Key.InputMapId == 0x10000005u)
.Select(entry => entry.Value)
.Where(action => action.ToString().StartsWith(
"UseSpellSlot_",
StringComparison.Ordinal))
.ToArray();
Assert.Equal(12, slots.Length);
Assert.Equal(
Enumerable.Range(0, 12),
slots.Select(action =>
{
Assert.True(
SpellcastingUiController.TryMapSpellShortcut(
action,
out int index),
$"No favorite-spell consumer for {action}");
return index;
}).Order());
}
[Theory]
[InlineData(InputAction.UseSpellSlot_1, 0)]
[InlineData(InputAction.UseSpellSlot_9, 8)]
[InlineData(InputAction.UseSpellSlot_10, 9)]
[InlineData(InputAction.UseSpellSlot_11, 10)]
[InlineData(InputAction.UseSpellSlot_12, 11)]
public void AllRetailSpellSlotsMapToFavoriteIndex(
InputAction action,
int expectedIndex)
{
Assert.True(
SpellcastingUiController.TryMapSpellShortcut(action, out int index));
Assert.Equal(expectedIndex, index);
}
}