1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 08:12:55 +08:00

Rewrite test to check selection state during and after new control point placement

This commit is contained in:
Bartłomiej Dach 2021-12-22 10:57:39 +01:00
parent c3fada1926
commit ef20182a34
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -100,13 +100,20 @@ namespace osu.Game.Rulesets.Osu.Tests.Editor
AddStep("ctrl+click to create new point", () =>
{
InputManager.PressKey(Key.ControlLeft);
InputManager.Click(MouseButton.Left);
InputManager.ReleaseKey(Key.ControlLeft);
InputManager.PressButton(MouseButton.Left);
});
AddAssert("slider has 6 control points", () => slider.Path.ControlPoints.Count == 6);
assertSelectionCount(1);
assertSelected(3);
AddStep("release ctrl+click", () =>
{
InputManager.ReleaseButton(MouseButton.Left);
InputManager.ReleaseKey(Key.ControlLeft);
});
assertSelectionCount(1);
assertSelected(3);
void assertSelectionCount(int count) =>
AddAssert($"{count} control point pieces selected", () => this.ChildrenOfType<PathControlPointPiece>().Count(piece => piece.IsSelected.Value) == count);