mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 02:33:02 +08:00
Fix test that never should have worked
This was only working by luck until now. It was "correctly" matching on
null online ID (see logic at
abc96057b2/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs (L199-L207)
).
Now it works by actually matching on the online ID.
This commit is contained in:
parent
f6180b7e6a
commit
1bbfbb0d8e
@ -111,10 +111,27 @@ namespace osu.Game.Tests.Visual.Playlists
|
|||||||
public void TestBeatmapUpdatedOnReImport()
|
public void TestBeatmapUpdatedOnReImport()
|
||||||
{
|
{
|
||||||
BeatmapSetInfo importedSet = null;
|
BeatmapSetInfo importedSet = null;
|
||||||
|
TestBeatmap beatmap = null;
|
||||||
|
|
||||||
|
// this step is required to make sure the further imports actually get online IDs.
|
||||||
|
// all the playlist logic relies on online ID matching.
|
||||||
|
AddStep("remove all matching online IDs", () =>
|
||||||
|
{
|
||||||
|
beatmap = new TestBeatmap(new OsuRuleset().RulesetInfo);
|
||||||
|
|
||||||
|
var existing = manager.QueryBeatmapSets(s => s.OnlineBeatmapSetID == beatmap.BeatmapInfo.BeatmapSet.OnlineBeatmapSetID).ToList();
|
||||||
|
|
||||||
|
foreach (var s in existing)
|
||||||
|
{
|
||||||
|
s.OnlineBeatmapSetID = null;
|
||||||
|
foreach (var b in s.Beatmaps)
|
||||||
|
b.OnlineBeatmapID = null;
|
||||||
|
manager.Update(s);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
AddStep("import altered beatmap", () =>
|
AddStep("import altered beatmap", () =>
|
||||||
{
|
{
|
||||||
var beatmap = new TestBeatmap(new OsuRuleset().RulesetInfo);
|
|
||||||
beatmap.BeatmapInfo.BaseDifficulty.CircleSize = 1;
|
beatmap.BeatmapInfo.BaseDifficulty.CircleSize = 1;
|
||||||
|
|
||||||
importedSet = manager.Import(beatmap.BeatmapInfo.BeatmapSet).Result;
|
importedSet = manager.Import(beatmap.BeatmapInfo.BeatmapSet).Result;
|
||||||
|
Loading…
Reference in New Issue
Block a user