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

Fix tests maybe

This commit is contained in:
Bartłomiej Dach 2024-07-29 15:28:52 +02:00
parent b46f3c97da
commit b77a10b6db
No known key found for this signature in database

View File

@ -76,8 +76,12 @@ namespace osu.Game.Tests.Visual.DailyChallenge
AddStep("set daily challenge info", () => metadataClient.DailyChallengeInfo.Value = new DailyChallengeInfo { RoomID = 1234 }); AddStep("set daily challenge info", () => metadataClient.DailyChallengeInfo.Value = new DailyChallengeInfo { RoomID = 1234 });
AddStep("push screen", () => LoadScreen(new Screens.OnlinePlay.DailyChallenge.DailyChallenge(room))); AddStep("push screen", () => LoadScreen(new Screens.OnlinePlay.DailyChallenge.DailyChallenge(room)));
AddStep("daily challenge ended", () => metadataClient.DailyChallengeInfo.Value = null); AddStep("daily challenge ended", () => metadataClient.DailyChallengeInfo.Value = null);
Func<APIRequest, bool>? previousHandler = null;
AddStep("install custom handler", () => AddStep("install custom handler", () =>
{ {
previousHandler = ((DummyAPIAccess)API).HandleRequest;
((DummyAPIAccess)API).HandleRequest = req => ((DummyAPIAccess)API).HandleRequest = req =>
{ {
switch (req) switch (req)
@ -108,6 +112,8 @@ namespace osu.Game.Tests.Visual.DailyChallenge
}; };
}); });
AddStep("next daily challenge started", () => metadataClient.DailyChallengeInfo.Value = new DailyChallengeInfo { RoomID = 1235 }); AddStep("next daily challenge started", () => metadataClient.DailyChallengeInfo.Value = new DailyChallengeInfo { RoomID = 1235 });
AddStep("restore previous handler", () => ((DummyAPIAccess)API).HandleRequest = previousHandler);
} }
} }
} }