1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 23:12:56 +08:00

Revert "Clean up DirectDownloadButton test scene"

This reverts commit baabe99f78.
This commit is contained in:
Dean Herbert 2021-11-04 17:09:20 +09:00
parent 8f459e6ce8
commit 77be610b26

View File

@ -40,14 +40,14 @@ namespace osu.Game.Tests.Visual.Online
{
AddUntilStep("ensure manager loaded", () => beatmaps != null);
ensureSoleilyRemoved();
createButtonWithBeatmap(CreateAPIBeatmapSet());
createButtonWithBeatmap(createSoleily());
AddAssert("button state not downloaded", () => downloadButton.DownloadState == DownloadState.NotDownloaded);
AddStep("import soleily", () => beatmaps.Import(TestResources.GetQuickTestBeatmapForImport()));
AddUntilStep("wait for beatmap import", () => beatmaps.GetAllUsableBeatmapSets().Any(b => b.OnlineBeatmapSetID == 241526));
AddAssert("button state downloaded", () => downloadButton.DownloadState == DownloadState.LocallyAvailable);
createButtonWithBeatmap(CreateAPIBeatmapSet());
createButtonWithBeatmap(createSoleily());
AddAssert("button state downloaded", () => downloadButton.DownloadState == DownloadState.LocallyAvailable);
ensureSoleilyRemoved();
AddAssert("button state not downloaded", () => downloadButton.DownloadState == DownloadState.NotDownloaded);
@ -68,7 +68,7 @@ namespace osu.Game.Tests.Visual.Online
AddAssert($"button {(enabled ? "enabled" : "disabled")}", () => downloadButton.DownloadEnabled == enabled);
}
private void createButtonWithBeatmap(APIBeatmapSet beatmap)
private void createButtonWithBeatmap(IBeatmapSetInfo beatmap)
{
AddStep("create button", () =>
{
@ -94,7 +94,20 @@ namespace osu.Game.Tests.Visual.Online
});
}
private APIBeatmapSet getDownloadableBeatmapSet()
private IBeatmapSetInfo createSoleily()
{
return new APIBeatmapSet
{
OnlineID = 241526,
Availability = new BeatmapSetOnlineAvailability
{
DownloadDisabled = false,
ExternalLink = string.Empty,
},
};
}
private IBeatmapSetInfo getDownloadableBeatmapSet()
{
var apiBeatmapSet = CreateAPIBeatmapSet();
@ -104,7 +117,7 @@ namespace osu.Game.Tests.Visual.Online
return apiBeatmapSet;
}
private APIBeatmapSet getUndownloadableBeatmapSet()
private IBeatmapSetInfo getUndownloadableBeatmapSet()
{
var apiBeatmapSet = CreateAPIBeatmapSet();
@ -130,7 +143,7 @@ namespace osu.Game.Tests.Visual.Online
public DownloadState DownloadState => State.Value;
public TestDownloadButton(APIBeatmapSet beatmapSet)
public TestDownloadButton(IBeatmapSetInfo beatmapSet)
: base(beatmapSet)
{
}