1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +08:00

Clean up DirectDownloadButton test scene

This commit is contained in:
Dean Herbert 2021-11-01 15:38:45 +09:00
parent a5a7181915
commit baabe99f78

View File

@ -40,14 +40,14 @@ namespace osu.Game.Tests.Visual.Online
{
AddUntilStep("ensure manager loaded", () => beatmaps != null);
ensureSoleilyRemoved();
createButtonWithBeatmap(createSoleily());
createButtonWithBeatmap(CreateAPIBeatmapSet());
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(createSoleily());
createButtonWithBeatmap(CreateAPIBeatmapSet());
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(IBeatmapSetInfo beatmap)
private void createButtonWithBeatmap(APIBeatmapSet beatmap)
{
AddStep("create button", () =>
{
@ -94,20 +94,7 @@ namespace osu.Game.Tests.Visual.Online
});
}
private IBeatmapSetInfo createSoleily()
{
return new APIBeatmapSet
{
OnlineID = 241526,
Availability = new BeatmapSetOnlineAvailability
{
DownloadDisabled = false,
ExternalLink = string.Empty,
},
};
}
private IBeatmapSetInfo getDownloadableBeatmapSet()
private APIBeatmapSet getDownloadableBeatmapSet()
{
var apiBeatmapSet = CreateAPIBeatmapSet();
@ -117,7 +104,7 @@ namespace osu.Game.Tests.Visual.Online
return apiBeatmapSet;
}
private IBeatmapSetInfo getUndownloadableBeatmapSet()
private APIBeatmapSet getUndownloadableBeatmapSet()
{
var apiBeatmapSet = CreateAPIBeatmapSet();
@ -143,7 +130,7 @@ namespace osu.Game.Tests.Visual.Online
public DownloadState DownloadState => State.Value;
public TestDownloadButton(IBeatmapSetInfo beatmapSet)
public TestDownloadButton(APIBeatmapSet beatmapSet)
: base(beatmapSet)
{
}