Merge pull request #18915 from peppy/slider-snaking-test-refactoring

Apply various refactorings to `TestSceneSliderSnaking`
This commit is contained in:
Dan Balasescu
2022-06-28 16:16:35 +09:00
committed by GitHub
6 changed files with 22 additions and 30 deletions

View File

@ -121,7 +121,7 @@ namespace osu.Game.Tests.Visual.Gameplay
private void createPlayerTest()
{
CreateTest(null);
CreateTest();
AddAssert("storyboard loaded", () => Player.Beatmap.Value.Storyboard != null);
waitUntilStoryboardSamplesPlay();

View File

@ -53,7 +53,7 @@ namespace osu.Game.Tests.Visual.Gameplay
public void TestStoryboardSkipOutro()
{
AddStep("set storyboard duration to long", () => currentStoryboardDuration = 200000);
CreateTest(null);
CreateTest();
AddUntilStep("completion set by processor", () => Player.ScoreProcessor.HasCompleted.Value);
AddStep("skip outro", () => InputManager.Key(osuTK.Input.Key.Space));
AddUntilStep("player is no longer current screen", () => !Player.IsCurrentScreen());
@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual.Gameplay
[Test]
public void TestStoryboardNoSkipOutro()
{
CreateTest(null);
CreateTest();
AddUntilStep("storyboard ends", () => Player.GameplayClockContainer.GameplayClock.CurrentTime >= currentStoryboardDuration);
AddUntilStep("wait for score shown", () => Player.IsScoreShown);
}
@ -71,7 +71,7 @@ namespace osu.Game.Tests.Visual.Gameplay
[Test]
public void TestStoryboardExitDuringOutroStillExits()
{
CreateTest(null);
CreateTest();
AddUntilStep("completion set by processor", () => Player.ScoreProcessor.HasCompleted.Value);
AddStep("exit via pause", () => Player.ExitViaPause());
AddAssert("player exited", () => !Player.IsCurrentScreen() && Player.GetChildScreen() == null);
@ -81,7 +81,7 @@ namespace osu.Game.Tests.Visual.Gameplay
[TestCase(true)]
public void TestStoryboardToggle(bool enabledAtBeginning)
{
CreateTest(null);
CreateTest();
AddStep($"{(enabledAtBeginning ? "enable" : "disable")} storyboard", () => LocalConfig.SetValue(OsuSetting.ShowStoryboard, enabledAtBeginning));
AddStep("toggle storyboard", () => LocalConfig.SetValue(OsuSetting.ShowStoryboard, !enabledAtBeginning));
AddUntilStep("wait for score shown", () => Player.IsScoreShown);
@ -130,7 +130,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{
SkipOverlay.FadeContainer fadeContainer() => Player.ChildrenOfType<SkipOverlay.FadeContainer>().First();
CreateTest(null);
CreateTest();
AddUntilStep("completion set by processor", () => Player.ScoreProcessor.HasCompleted.Value);
AddUntilStep("skip overlay content becomes visible", () => fadeContainer().State == Visibility.Visible);
@ -144,7 +144,7 @@ namespace osu.Game.Tests.Visual.Gameplay
[Test]
public void TestPerformExitNoOutro()
{
CreateTest(null);
CreateTest();
AddStep("disable storyboard", () => LocalConfig.SetValue(OsuSetting.ShowStoryboard, false));
AddUntilStep("completion set by processor", () => Player.ScoreProcessor.HasCompleted.Value);
AddStep("exit via pause", () => Player.ExitViaPause());