1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 04:02:57 +08:00

Fix TestScenePresentScore sharing metadata/difficulty across multiple beatmaps

This commit is contained in:
Dean Herbert 2022-01-10 13:03:25 +09:00
parent 6251713796
commit fa7dddcf3c

View File

@ -8,6 +8,7 @@ using osu.Framework.Extensions;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Online.API;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Rulesets.Mania; using osu.Game.Rulesets.Mania;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
@ -28,14 +29,6 @@ namespace osu.Game.Tests.Visual.Navigation
{ {
AddStep("import beatmap", () => AddStep("import beatmap", () =>
{ {
var difficulty = new BeatmapDifficulty();
var metadata = new BeatmapMetadata
{
Artist = "SomeArtist",
AuthorString = "SomeAuthor",
Title = "import"
};
beatmap = Game.BeatmapManager.Import(new BeatmapSetInfo beatmap = Game.BeatmapManager.Import(new BeatmapSetInfo
{ {
Hash = Guid.NewGuid().ToString(), Hash = Guid.NewGuid().ToString(),
@ -45,19 +38,29 @@ namespace osu.Game.Tests.Visual.Navigation
new BeatmapInfo new BeatmapInfo
{ {
OnlineID = 1 * 1024, OnlineID = 1 * 1024,
Metadata = metadata, Metadata = new BeatmapMetadata
BaseDifficulty = difficulty, {
Artist = "SomeArtist",
AuthorString = "SomeAuthor",
Title = "import"
},
BaseDifficulty = new BeatmapDifficulty(),
Ruleset = new OsuRuleset().RulesetInfo Ruleset = new OsuRuleset().RulesetInfo
}, },
new BeatmapInfo new BeatmapInfo
{ {
OnlineID = 1 * 2048, OnlineID = 1 * 2048,
Metadata = metadata, Metadata = new BeatmapMetadata
BaseDifficulty = difficulty, {
Artist = "SomeArtist",
AuthorString = "SomeAuthor",
Title = "import"
},
BaseDifficulty = new BeatmapDifficulty(),
Ruleset = new OsuRuleset().RulesetInfo Ruleset = new OsuRuleset().RulesetInfo
}, },
} }
}).GetResultSafely().Value; }).GetResultSafely()?.Value;
}); });
} }
@ -130,7 +133,8 @@ namespace osu.Game.Tests.Visual.Navigation
Hash = Guid.NewGuid().ToString(), Hash = Guid.NewGuid().ToString(),
OnlineID = i, OnlineID = i,
BeatmapInfo = beatmap.Beatmaps.First(), BeatmapInfo = beatmap.Beatmaps.First(),
Ruleset = ruleset ?? new OsuRuleset().RulesetInfo Ruleset = ruleset ?? new OsuRuleset().RulesetInfo,
User = new GuestUser(),
}).GetResultSafely().Value; }).GetResultSafely().Value;
}); });