1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 02:22:59 +08:00

Add test coverage of touching and missing not enabled touch mod

This commit is contained in:
Dean Herbert 2023-11-06 17:17:19 +09:00
parent 7ba07ab530
commit b62811633f
No known key found for this signature in database

View File

@ -104,6 +104,24 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
AddAssert("no toasts displayed", () => testOnScreenDisplay.ToastCount, () => Is.Zero);
}
[Test]
public void TestTouchMiss()
{
// ensure mouse is active (and that it's not suppressed due to touches in previous tests)
AddStep("click mouse", () => InputManager.Click(MouseButton.Left));
AddUntilStep("wait until 200 near", () => Player.GameplayClockContainer.CurrentTime, () => Is.GreaterThanOrEqualTo(200).Within(500));
AddStep("slow down", () => Player.GameplayClockContainer.AdjustmentsFromMods.Frequency.Value = 0.2);
AddUntilStep("wait until 200", () => Player.GameplayClockContainer.CurrentTime, () => Is.GreaterThanOrEqualTo(200));
AddStep("touch playfield", () =>
{
var touch = new Touch(TouchSource.Touch1, Player.DrawableRuleset.Playfield.ScreenSpaceDrawQuad.Centre);
InputManager.BeginTouch(touch);
InputManager.EndTouch(touch);
});
AddAssert("touch device mod not activated", () => Player.Mods.Value, () => Has.No.InstanceOf<OsuModTouchDevice>());
}
[Test]
public void TestSecondObjectTouched()
{