Skip to content

Commit

Permalink
Add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzibyte committed Oct 25, 2024
1 parent a6cc782 commit 7862073
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,26 @@ private void addTestInputManagerStep()
ChildrenEnumerable = Enumerable.Empty<Drawable>();
});

[Test]
public void TestInitialState()
{
AddStep("Press buttons", () =>
{
InputManager.PressButton(MouseButton.Left);
InputManager.PressKey(Key.A);
InputManager.PressJoystickButton(JoystickButton.Button1);
});
addTestInputManagerStep();
AddAssert("pressed", () => mouse.IsPressed(MouseButton.Left) && keyboard.IsPressed(Key.A) && joystick.IsPressed(JoystickButton.Button1));
AddStep("Release on parent", () =>
{
InputManager.ReleaseButton(MouseButton.Left);
InputManager.ReleaseKey(Key.A);
InputManager.ReleaseJoystickButton(JoystickButton.Button1);
});
AddAssert("released", () => !mouse.IsPressed(MouseButton.Left) && !keyboard.IsPressed(Key.A) && !joystick.IsPressed(JoystickButton.Button1));
}

[Test]
public void UseParentInputChange()
{
Expand Down

0 comments on commit 7862073

Please sign in to comment.