mirror of https://github.com/ppy/osu
Add failing test steps for selection behaviour on new point creation
This commit is contained in:
parent
e22745397d
commit
307d3709e0
|
@ -92,6 +92,21 @@ public void TestSelection()
|
||||||
assertSelectionCount(1);
|
assertSelectionCount(1);
|
||||||
assertSelected(0);
|
assertSelected(0);
|
||||||
|
|
||||||
|
AddStep("move mouse to new point position", () =>
|
||||||
|
{
|
||||||
|
Vector2 position = slider.Position + (slider.Path.ControlPoints[2].Position + slider.Path.ControlPoints[3].Position) / 2;
|
||||||
|
InputManager.MoveMouseTo(drawableObject.Parent.ToScreenSpace(position));
|
||||||
|
});
|
||||||
|
AddStep("ctrl+click to create new point", () =>
|
||||||
|
{
|
||||||
|
InputManager.PressKey(Key.ControlLeft);
|
||||||
|
InputManager.Click(MouseButton.Left);
|
||||||
|
InputManager.ReleaseKey(Key.ControlLeft);
|
||||||
|
});
|
||||||
|
AddAssert("slider has 6 control points", () => slider.Path.ControlPoints.Count == 6);
|
||||||
|
assertSelectionCount(1);
|
||||||
|
assertSelected(3);
|
||||||
|
|
||||||
void assertSelectionCount(int count) =>
|
void assertSelectionCount(int count) =>
|
||||||
AddAssert($"{count} control point pieces selected", () => this.ChildrenOfType<PathControlPointPiece>().Count(piece => piece.IsSelected.Value) == count);
|
AddAssert($"{count} control point pieces selected", () => this.ChildrenOfType<PathControlPointPiece>().Count(piece => piece.IsSelected.Value) == count);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue