1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 09:17:48 +08:00
osu-lazer/osu.Game.Tests/Visual/Gameplay/TestSceneDelayedResumeOverlay.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.2 KiB
C#
Raw Normal View History

2024-03-04 15:08:25 +08:00
// 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;
}
}
}