mirror of
https://github.com/ppy/osu.git
synced 2024-12-05 10:23:20 +08:00
Merge pull request #8476 from bdach/fix-loader-tests
Improve robustness of loader tests
This commit is contained in:
commit
0471efc885
@ -36,8 +36,6 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
[Test]
|
||||
public void TestInstantLoad()
|
||||
{
|
||||
// visual only, very impossible to test this using asserts.
|
||||
|
||||
AddStep("load immediately", () =>
|
||||
{
|
||||
loader = new TestLoader();
|
||||
@ -46,12 +44,17 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
LoadScreen(loader);
|
||||
});
|
||||
|
||||
AddAssert("spinner did not display", () => loader.LoadingSpinner?.Alpha == 0);
|
||||
spinnerNotPresentOrHidden();
|
||||
|
||||
AddUntilStep("loaded", () => loader.ScreenLoaded);
|
||||
AddUntilStep("not current", () => !loader.IsCurrentScreen());
|
||||
|
||||
spinnerNotPresentOrHidden();
|
||||
}
|
||||
|
||||
private void spinnerNotPresentOrHidden() =>
|
||||
AddAssert("spinner did not display", () => loader.LoadingSpinner == null || loader.LoadingSpinner.Alpha == 0);
|
||||
|
||||
[Test]
|
||||
public void TestDelayedLoad()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user