mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 16:03:01 +08:00
Add failing test case
This commit is contained in:
parent
2b0f2a6db9
commit
5f1948d040
@ -76,5 +76,23 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
AddStep("restore default", () => sliderBar.Current.SetDefault());
|
AddStep("restore default", () => sliderBar.Current.SetDefault());
|
||||||
AddUntilStep("restore button hidden", () => restoreDefaultValueButton.Alpha == 0);
|
AddUntilStep("restore button hidden", () => restoreDefaultValueButton.Alpha == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestWarningTextVisibility()
|
||||||
|
{
|
||||||
|
SettingsNumberBox numberBox = null;
|
||||||
|
|
||||||
|
AddStep("create settings item", () => Child = numberBox = new SettingsNumberBox());
|
||||||
|
AddAssert("warning text not created", () => !numberBox.ChildrenOfType<SettingsNoticeText>().Any());
|
||||||
|
|
||||||
|
AddStep("set warning text", () => numberBox.WarningText = "this is a warning!");
|
||||||
|
AddAssert("warning text created", () => numberBox.ChildrenOfType<SettingsNoticeText>().Single().Alpha == 1);
|
||||||
|
|
||||||
|
AddStep("unset warning text", () => numberBox.WarningText = default);
|
||||||
|
AddAssert("warning text hidden", () => numberBox.ChildrenOfType<SettingsNoticeText>().Single().Alpha == 0);
|
||||||
|
|
||||||
|
AddStep("set warning text again", () => numberBox.WarningText = "another warning!");
|
||||||
|
AddAssert("warning text shown again", () => numberBox.ChildrenOfType<SettingsNoticeText>().Single().Alpha == 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user