From baabe99f789aea701030531d538780efc7830dd0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 1 Nov 2021 15:38:45 +0900 Subject: [PATCH] Clean up `DirectDownloadButton` test scene --- .../Online/TestSceneDirectDownloadButton.cs | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs b/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs index 3d828077c8..8d7e0f9f0c 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneDirectDownloadButton.cs @@ -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) { }