1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 23:17:51 +08:00
osu-lazer/osu.Game.Tests/Visual/Gameplay/TestSceneDelayedResumeOverlay.cs
2024-03-04 16:50:24 +09:00

45 lines
1.2 KiB
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Osu;
using osu.Game.Screens.Play;
using osu.Game.Tests.Gameplay;
namespace osu.Game.Tests.Visual.Gameplay
{
public partial class TestSceneDelayedResumeOverlay : OsuTestScene
{
private ResumeOverlay resume = null!;
private bool resumeFired;
[Cached]
private GameplayState gameplayState;
public TestSceneDelayedResumeOverlay()
{
gameplayState = TestGameplayState.Create(new OsuRuleset());
}
[SetUp]
public void SetUp() => Schedule(loadContent);
[Test]
public void TestResume()
{
AddStep("show", () => resume.Show());
AddUntilStep("dismissed", () => resumeFired && resume.State.Value == Visibility.Hidden);
}
private void loadContent()
{
Child = resume = new DelayedResumeOverlay();
resumeFired = false;
resume.ResumeAction = () => resumeFired = true;
}
}
}