mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 00:09:55 +09:00
Simplify input buttons/keys in tests
This commit is contained in:
@ -48,7 +48,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
});
|
||||
AddStep("enter text", () => commentEditor.Current.Value = "text");
|
||||
|
||||
AddStep("press Enter", () => press(Key.Enter));
|
||||
AddStep("press Enter", () => InputManager.Key(Key.Enter));
|
||||
|
||||
AddAssert("text committed", () => commentEditor.CommittedText == "text");
|
||||
AddAssert("button is loading", () => commentEditor.IsLoading);
|
||||
@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
|
||||
AddStep("press Enter", () => press(Key.Enter));
|
||||
AddStep("press Enter", () => InputManager.Key(Key.Enter));
|
||||
|
||||
AddAssert("no text committed", () => commentEditor.CommittedText == null);
|
||||
AddAssert("button is not loading", () => !commentEditor.IsLoading);
|
||||
@ -101,12 +101,6 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
AddAssert("cancel action fired", () => cancellableCommentEditor.Cancelled);
|
||||
}
|
||||
|
||||
private void press(Key key)
|
||||
{
|
||||
InputManager.PressKey(key);
|
||||
InputManager.ReleaseKey(key);
|
||||
}
|
||||
|
||||
private class TestCommentEditor : CommentEditor
|
||||
{
|
||||
public new Bindable<string> Current => base.Current;
|
||||
|
Reference in New Issue
Block a user