1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:02:55 +08:00
This commit is contained in:
Dean Herbert 2020-04-16 10:44:08 +09:00
parent ce21cfbb03
commit 06e25091f6

View File

@ -21,12 +21,12 @@ namespace osu.Game.Tests.Visual.UserInterface
}; };
private OsuMenu menu; private OsuMenu menu;
private bool actionPeformed; private bool actionPerformed;
[SetUp] [SetUp]
public void Setup() => Schedule(() => public void Setup() => Schedule(() =>
{ {
actionPeformed = false; actionPerformed = false;
Child = menu = new OsuMenu(Direction.Vertical, true) Child = menu = new OsuMenu(Direction.Vertical, true)
{ {
@ -47,7 +47,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("move to first menu item", () => InputManager.MoveMouseTo(menu.ChildrenOfType<DrawableOsuMenuItem>().First())); AddStep("move to first menu item", () => InputManager.MoveMouseTo(menu.ChildrenOfType<DrawableOsuMenuItem>().First()));
AddStep("click", () => InputManager.Click(MouseButton.Left)); AddStep("click", () => InputManager.Click(MouseButton.Left));
AddAssert("action performed", () => actionPeformed); AddAssert("action performed", () => actionPerformed);
} }
[Test] [Test]
@ -62,7 +62,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("move to first menu item", () => InputManager.MoveMouseTo(menu.ChildrenOfType<DrawableOsuMenuItem>().First())); AddStep("move to first menu item", () => InputManager.MoveMouseTo(menu.ChildrenOfType<DrawableOsuMenuItem>().First()));
AddStep("click", () => InputManager.Click(MouseButton.Left)); AddStep("click", () => InputManager.Click(MouseButton.Left));
AddAssert("action not performed", () => !actionPeformed); AddAssert("action not performed", () => !actionPerformed);
} }
[Test] [Test]
@ -83,9 +83,9 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("move to first menu item", () => InputManager.MoveMouseTo(menu.ChildrenOfType<DrawableOsuMenuItem>().First())); AddStep("move to first menu item", () => InputManager.MoveMouseTo(menu.ChildrenOfType<DrawableOsuMenuItem>().First()));
AddStep("click", () => InputManager.Click(MouseButton.Left)); AddStep("click", () => InputManager.Click(MouseButton.Left));
AddAssert("action performed", () => actionPeformed); AddAssert("action performed", () => actionPerformed);
} }
private void performAction() => actionPeformed = true; private void performAction() => actionPerformed = true;
} }
} }