1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 07:22:54 +08:00

Fix test failure due to TestMetadataClient providing null statistics array

This commit is contained in:
Dean Herbert 2024-07-31 02:53:10 +09:00
parent d75c170ba1
commit 5ebb5ad670
No known key found for this signature in database
2 changed files with 10 additions and 2 deletions

View File

@ -29,6 +29,7 @@ namespace osu.Game.Tests.Visual.DailyChallenge
private void load() private void load()
{ {
base.Content.Add(notificationOverlay); base.Content.Add(notificationOverlay);
base.Content.Add(metadataClient);
} }
[Test] [Test]
@ -63,7 +64,7 @@ namespace osu.Game.Tests.Visual.DailyChallenge
Name = { Value = "Daily Challenge: June 4, 2024" }, Name = { Value = "Daily Challenge: June 4, 2024" },
Playlist = Playlist =
{ {
new PlaylistItem(CreateAPIBeatmapSet().Beatmaps.First()) new PlaylistItem(TestResources.CreateTestBeatmapSetInfo().Beatmaps.First())
{ {
RequiredMods = [new APIMod(new OsuModTraceable())], RequiredMods = [new APIMod(new OsuModTraceable())],
AllowedMods = [new APIMod(new OsuModDoubleTime())] AllowedMods = [new APIMod(new OsuModDoubleTime())]

View File

@ -88,7 +88,14 @@ namespace osu.Game.Tests.Visual.Metadata
} }
public override Task<MultiplayerPlaylistItemStats[]> BeginWatchingMultiplayerRoom(long id) public override Task<MultiplayerPlaylistItemStats[]> BeginWatchingMultiplayerRoom(long id)
=> Task.FromResult(new MultiplayerPlaylistItemStats[MultiplayerPlaylistItemStats.TOTAL_SCORE_DISTRIBUTION_BINS]); {
var stats = new MultiplayerPlaylistItemStats[MultiplayerPlaylistItemStats.TOTAL_SCORE_DISTRIBUTION_BINS];
for (int i = 0; i < stats.Length; i++)
stats[i] = new MultiplayerPlaylistItemStats { PlaylistItemID = i };
return Task.FromResult(stats);
}
public override Task EndWatchingMultiplayerRoom(long id) => Task.CompletedTask; public override Task EndWatchingMultiplayerRoom(long id) => Task.CompletedTask;
} }