mirror of
https://github.com/ppy/osu.git
synced 2025-03-01 01:43:26 +08:00
Use a local database for now playing test
This commit is contained in:
parent
81e73acb1a
commit
743a92bbbe
@ -4,9 +4,12 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.UserInterface
|
namespace osu.Game.Tests.Visual.UserInterface
|
||||||
@ -21,9 +24,14 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
private NowPlayingOverlay nowPlayingOverlay;
|
private NowPlayingOverlay nowPlayingOverlay;
|
||||||
|
|
||||||
|
private RulesetStore rulesets;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load(AudioManager audio, GameHost host)
|
||||||
{
|
{
|
||||||
|
Dependencies.Cache(rulesets = new RulesetStore(ContextFactory));
|
||||||
|
Dependencies.Cache(manager = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, audio, host, Beatmap.Default));
|
||||||
|
|
||||||
Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
Beatmap.Value = CreateWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
||||||
|
|
||||||
nowPlayingOverlay = new NowPlayingOverlay
|
nowPlayingOverlay = new NowPlayingOverlay
|
||||||
@ -44,9 +52,10 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
AddStep(@"hide", () => nowPlayingOverlay.Hide());
|
AddStep(@"hide", () => nowPlayingOverlay.Hide());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Resolved]
|
|
||||||
private BeatmapManager manager { get; set; }
|
private BeatmapManager manager { get; set; }
|
||||||
|
|
||||||
|
private int importId = 0;
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestPrevTrackBehavior()
|
public void TestPrevTrackBehavior()
|
||||||
{
|
{
|
||||||
@ -62,7 +71,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
},
|
},
|
||||||
Metadata = new BeatmapMetadata
|
Metadata = new BeatmapMetadata
|
||||||
{
|
{
|
||||||
Artist = "a test map",
|
Artist = $"a test map {importId++}",
|
||||||
Title = "title",
|
Title = "title",
|
||||||
}
|
}
|
||||||
}).Wait(), 5);
|
}).Wait(), 5);
|
||||||
|
Loading…
Reference in New Issue
Block a user