1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 13:10:12 +08:00

Implement instantaneous SliderWithTextBoxInput mode

This commit is contained in:
Bartłomiej Dach
2023-08-01 00:51:29 +02:00
Unverified
parent 0b019f1d45
commit 4fb0ff8800
2 changed files with 88 additions and 44 deletions
@@ -40,6 +40,8 @@ namespace osu.Game.Tests.Visual.UserInterface
[Test]
public void TestNonInstantaneousMode()
{
AddStep("set instantaneous to false", () => sliderWithTextBoxInput.Instantaneous = false);
AddStep("focus textbox", () => InputManager.ChangeFocus(textBox));
AddStep("change text", () => textBox.Text = "3");
AddAssert("slider not moved", () => slider.Current.Value, () => Is.Zero);
@@ -63,6 +65,8 @@ namespace osu.Game.Tests.Visual.UserInterface
[Test]
public void TestInstantaneousMode()
{
AddStep("set instantaneous to true", () => sliderWithTextBoxInput.Instantaneous = true);
AddStep("focus textbox", () => InputManager.ChangeFocus(textBox));
AddStep("change text", () => textBox.Text = "3");
AddAssert("slider moved", () => slider.Current.Value, () => Is.EqualTo(3));