mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 07:42:57 +08:00
Add more test steps for input handling edge cases
This commit is contained in:
parent
d2417beeac
commit
cdb587d956
@ -1,7 +1,9 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Testing;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
@ -76,9 +78,14 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
|
|||||||
|
|
||||||
moveMouseToControlPoint(2);
|
moveMouseToControlPoint(2);
|
||||||
AddStep("hold left mouse", () => InputManager.PressButton(MouseButton.Left));
|
AddStep("hold left mouse", () => InputManager.PressButton(MouseButton.Left));
|
||||||
|
|
||||||
|
AddAssert("three control point pieces selected", () => this.ChildrenOfType<PathControlPointPiece>().Count(piece => piece.IsSelected.Value) == 3);
|
||||||
|
|
||||||
addMovementStep(new Vector2(450, 50));
|
addMovementStep(new Vector2(450, 50));
|
||||||
AddStep("release left mouse", () => InputManager.ReleaseButton(MouseButton.Left));
|
AddStep("release left mouse", () => InputManager.ReleaseButton(MouseButton.Left));
|
||||||
|
|
||||||
|
AddAssert("three control point pieces selected", () => this.ChildrenOfType<PathControlPointPiece>().Count(piece => piece.IsSelected.Value) == 3);
|
||||||
|
|
||||||
assertControlPointPosition(2, new Vector2(450, 50));
|
assertControlPointPosition(2, new Vector2(450, 50));
|
||||||
assertControlPointType(2, PathType.PerfectCurve);
|
assertControlPointType(2, PathType.PerfectCurve);
|
||||||
|
|
||||||
@ -87,6 +94,10 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
|
|||||||
assertControlPointPosition(4, new Vector2(550, 200));
|
assertControlPointPosition(4, new Vector2(550, 200));
|
||||||
|
|
||||||
AddStep("release control", () => InputManager.ReleaseKey(Key.LControl));
|
AddStep("release control", () => InputManager.ReleaseKey(Key.LControl));
|
||||||
|
|
||||||
|
moveMouseToControlPoint(3);
|
||||||
|
AddStep("click left mouse", () => InputManager.Click(MouseButton.Left));
|
||||||
|
AddAssert("only one control point piece selected", () => this.ChildrenOfType<PathControlPointPiece>().Count(piece => piece.IsSelected.Value) == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
Loading…
Reference in New Issue
Block a user