mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Add failing test coverage of relax/autopilot scenarios
This commit is contained in:
parent
f387a6af57
commit
490f539c43
@ -122,7 +122,38 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSimpleInputButtonsDisabled()
|
public void TestMovementWhileDisallowed()
|
||||||
|
{
|
||||||
|
// aka "autopilot" mod
|
||||||
|
|
||||||
|
AddStep("Disallow gameplay cursor movement", () => osuInputManager.AllowUserCursorMovement = false);
|
||||||
|
|
||||||
|
Vector2? positionBefore = null;
|
||||||
|
|
||||||
|
AddStep("Store cursor position", () => positionBefore = osuInputManager.CurrentState.Mouse.Position);
|
||||||
|
beginTouch(TouchSource.Touch1);
|
||||||
|
|
||||||
|
assertKeyCounter(1, 0);
|
||||||
|
checkPressed(OsuAction.LeftButton);
|
||||||
|
AddAssert("Cursor position unchanged", () => osuInputManager.CurrentState.Mouse.Position, () => Is.EqualTo(positionBefore));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestActionWhileDisallowed()
|
||||||
|
{
|
||||||
|
// aka "relax" mod
|
||||||
|
|
||||||
|
AddStep("Disallow gameplay actions", () => osuInputManager.AllowGameplayInputs = false);
|
||||||
|
|
||||||
|
beginTouch(TouchSource.Touch1);
|
||||||
|
|
||||||
|
assertKeyCounter(0, 0);
|
||||||
|
checkNotPressed(OsuAction.LeftButton);
|
||||||
|
checkPosition(TouchSource.Touch1);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestInputWhileMouseButtonsDisabled()
|
||||||
{
|
{
|
||||||
AddStep("Disable mouse buttons", () => config.SetValue(OsuSetting.MouseDisableButtons, true));
|
AddStep("Disable mouse buttons", () => config.SetValue(OsuSetting.MouseDisableButtons, true));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user