mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Add test of existing slider placement behaviour for safety
This commit is contained in:
parent
9673985e2c
commit
c0814c2749
@ -73,6 +73,29 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
AddAssert("circle selected", () => EditorBeatmap.SelectedHitObjects, () => Has.One.Items);
|
AddAssert("circle selected", () => EditorBeatmap.SelectedHitObjects, () => Has.One.Items);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Solo]
|
||||||
|
public void TestCommitPlacementViaRightClick()
|
||||||
|
{
|
||||||
|
Playfield playfield = null!;
|
||||||
|
|
||||||
|
AddStep("select slider placement tool", () => InputManager.Key(Key.Number3));
|
||||||
|
AddStep("move mouse to top left of playfield", () =>
|
||||||
|
{
|
||||||
|
playfield = this.ChildrenOfType<Playfield>().Single();
|
||||||
|
var location = (3 * playfield.ScreenSpaceDrawQuad.TopLeft + playfield.ScreenSpaceDrawQuad.BottomRight) / 4;
|
||||||
|
InputManager.MoveMouseTo(location);
|
||||||
|
});
|
||||||
|
AddStep("begin placement", () => InputManager.Click(MouseButton.Left));
|
||||||
|
AddStep("move mouse to bottom right of playfield", () =>
|
||||||
|
{
|
||||||
|
var location = (playfield.ScreenSpaceDrawQuad.TopLeft + 3 * playfield.ScreenSpaceDrawQuad.BottomRight) / 4;
|
||||||
|
InputManager.MoveMouseTo(location);
|
||||||
|
});
|
||||||
|
AddStep("confirm via right click", () => InputManager.Click(MouseButton.Right));
|
||||||
|
AddAssert("slider placed", () => EditorBeatmap.HitObjects.Count, () => Is.EqualTo(1));
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestCommitPlacementViaGlobalAction()
|
public void TestCommitPlacementViaGlobalAction()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user