mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 01:02:55 +08:00
1fb4c814f4
The online ID will be reset unconditionally after any local change is made to any beatmap. That behaviour no longer depends on online lookups succeeding or failing. This may change at a later date when beatmap submission is integrated into lazer - the idea is that online IDs would get re-populated on local beatmaps once they are submitted to web.
38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
using System.Linq;
|
|
using NUnit.Framework;
|
|
using osu.Framework.Extensions;
|
|
using osu.Game.Database;
|
|
using osu.Game.Tests.Resources;
|
|
|
|
namespace osu.Game.Tests.Visual.Editing
|
|
{
|
|
public partial class TestSceneLocallyModifyingOnlineBeatmaps : EditorSavingTestScene
|
|
{
|
|
public override void SetUpSteps()
|
|
{
|
|
CreateInitialBeatmap = () =>
|
|
{
|
|
var importedSet = Game.BeatmapManager.Import(new ImportTask(TestResources.GetTestBeatmapForImport())).GetResultSafely();
|
|
return Game.BeatmapManager.GetWorkingBeatmap(importedSet!.Value.Beatmaps.First());
|
|
};
|
|
|
|
base.SetUpSteps();
|
|
}
|
|
|
|
[Test]
|
|
public void TestLocallyModifyingOnlineBeatmap()
|
|
{
|
|
AddAssert("editor beatmap has online ID", () => EditorBeatmap.BeatmapInfo.OnlineID, () => Is.GreaterThan(0));
|
|
|
|
AddStep("delete first hitobject", () => EditorBeatmap.RemoveAt(0));
|
|
SaveEditor();
|
|
|
|
ReloadEditorToSameBeatmap();
|
|
AddAssert("editor beatmap online ID reset", () => EditorBeatmap.BeatmapInfo.OnlineID, () => Is.EqualTo(-1));
|
|
}
|
|
}
|
|
}
|