mirror of
https://github.com/ppy/osu.git
synced 2024-11-19 03:52:55 +08:00
46 lines
1.3 KiB
C#
46 lines
1.3 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.
|
|
|
|
#nullable disable
|
|
|
|
using NUnit.Framework;
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics;
|
|
using osu.Game.Overlays;
|
|
using osu.Game.Rulesets.Osu;
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
|
{
|
|
[TestFixture]
|
|
public class TestSceneNowPlayingOverlay : OsuTestScene
|
|
{
|
|
[Cached]
|
|
private MusicController musicController = new MusicController();
|
|
|
|
private NowPlayingOverlay nowPlayingOverlay;
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load()
|
|
{
|
|
Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
|
|
|
nowPlayingOverlay = new NowPlayingOverlay
|
|
{
|
|
Origin = Anchor.Centre,
|
|
Anchor = Anchor.Centre
|
|
};
|
|
|
|
Add(musicController);
|
|
Add(nowPlayingOverlay);
|
|
}
|
|
|
|
[Test]
|
|
public void TestShowHideDisable()
|
|
{
|
|
AddStep(@"show", () => nowPlayingOverlay.Show());
|
|
AddToggleStep(@"toggle beatmap lock", state => Beatmap.Disabled = state);
|
|
AddStep(@"hide", () => nowPlayingOverlay.Hide());
|
|
}
|
|
}
|
|
}
|