mirror of
https://github.com/ppy/osu
synced 2025-01-31 10:22:02 +00:00
Wait for screen current
This commit is contained in:
parent
9a466d97ed
commit
8fb4de101f
@ -18,6 +18,7 @@ namespace osu.Game.Tests.Visual
|
||||
public class TestCaseOsuScreenStack : OsuTestCase
|
||||
{
|
||||
private NoParallaxTestScreen baseScreen;
|
||||
private TestScreen newScreen;
|
||||
private TestOsuScreenStack stack;
|
||||
|
||||
[SetUpSteps]
|
||||
@ -25,14 +26,17 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
AddStep("Create new screen stack", () => { Child = stack = new TestOsuScreenStack { RelativeSizeAxes = Axes.Both }; });
|
||||
AddStep("Push new base screen", () => stack.Push(baseScreen = new NoParallaxTestScreen("THIS IS SCREEN 1. THIS SCREEN SHOULD HAVE NO PARALLAX.")));
|
||||
AddUntilStep("Wait for Screen 1 to be current", baseScreen.IsCurrentScreen);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ParallaxAssignmentTest()
|
||||
{
|
||||
AddStep("Push new screen to base screen", () => baseScreen.Push(new TestScreen("THIS IS SCREEN 2. THIS SCREEN SHOULD HAVE PARALLAX.")));
|
||||
AddStep("Push new screen to base screen", () => baseScreen.Push(newScreen = new TestScreen("THIS IS SCREEN 2. THIS SCREEN SHOULD HAVE PARALLAX.")));
|
||||
AddUntilStep("Wait for Screen 2 to be current", newScreen.IsCurrentScreen);
|
||||
AddAssert("Parallax is correct", () => stack.IsParallaxSet);
|
||||
AddStep("Exit from new screen", () => { baseScreen.MakeCurrent(); });
|
||||
AddUntilStep("Wait for Screen 1 to be current", baseScreen.IsCurrentScreen);
|
||||
AddAssert("Parallax is correct", () => stack.IsParallaxSet);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user