mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Replace weird import handling
This commit is contained in:
parent
b096bf6cd1
commit
8076e22e70
@ -38,8 +38,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
Dependencies.Cache(rulesets = new RulesetStore(ContextFactory));
|
||||
Dependencies.Cache(manager = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, audio, Resources, host, Beatmap.Default));
|
||||
|
||||
manager.Import(new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo.BeatmapSet).Wait();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -204,7 +202,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
[Test]
|
||||
public void TestDownloadButtonHiddenWhenBeatmapExists()
|
||||
{
|
||||
createPlaylist(new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo);
|
||||
var beatmap = new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo;
|
||||
|
||||
AddStep("import beatmap", () => manager.Import(beatmap.BeatmapSet).Wait());
|
||||
|
||||
createPlaylist(beatmap);
|
||||
|
||||
assertDownloadButtonVisible(false);
|
||||
|
||||
|
@ -91,27 +91,16 @@ namespace osu.Game.Tests.Visual.Playlists
|
||||
{
|
||||
BeatmapSetInfo importedSet = 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", () =>
|
||||
{
|
||||
var existing = manager.QueryBeatmapSets(s => s.OnlineBeatmapSetID == importedBeatmap.Value.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", () =>
|
||||
{
|
||||
IBeatmap beatmap = CreateBeatmap(new OsuRuleset().RulesetInfo);
|
||||
|
||||
beatmap.BeatmapInfo.BaseDifficulty.CircleSize = 1;
|
||||
|
||||
// intentionally increment online IDs to clash with import below.
|
||||
beatmap.BeatmapInfo.OnlineBeatmapID++;
|
||||
beatmap.BeatmapInfo.BeatmapSet.OnlineBeatmapSetID++;
|
||||
|
||||
importedSet = manager.Import(beatmap.BeatmapInfo.BeatmapSet).Result.Value;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user