mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 17:57:38 +08:00
Merge pull request #15183 from bdach/fix-failing-assert-ruleset-tests
Fix ruleset template player tests failing due to null ruleset ID
This commit is contained in:
commit
05bd440cbb
@ -227,12 +227,13 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddAssert("ensure no submission", () => Player.SubmittedScore == null);
|
AddAssert("ensure no submission", () => Player.SubmittedScore == null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[TestCase(null)]
|
||||||
public void TestNoSubmissionOnCustomRuleset()
|
[TestCase(10)]
|
||||||
|
public void TestNoSubmissionOnCustomRuleset(int? rulesetId)
|
||||||
{
|
{
|
||||||
prepareTokenResponse(true);
|
prepareTokenResponse(true);
|
||||||
|
|
||||||
createPlayerTest(false, createRuleset: () => new OsuRuleset { RulesetInfo = { ID = 10 } });
|
createPlayerTest(false, createRuleset: () => new OsuRuleset { RulesetInfo = { ID = rulesetId } });
|
||||||
|
|
||||||
AddUntilStep("wait for token request", () => Player.TokenCreationRequested);
|
AddUntilStep("wait for token request", () => Player.TokenCreationRequested);
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -218,11 +217,10 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
Score = CreateScore(playableBeatmap);
|
Score = CreateScore(playableBeatmap);
|
||||||
|
|
||||||
Debug.Assert(ruleset.RulesetInfo.ID != null);
|
|
||||||
|
|
||||||
// ensure the score is in a consistent state with the current player.
|
// ensure the score is in a consistent state with the current player.
|
||||||
Score.ScoreInfo.BeatmapInfo = Beatmap.Value.BeatmapInfo;
|
Score.ScoreInfo.BeatmapInfo = Beatmap.Value.BeatmapInfo;
|
||||||
Score.ScoreInfo.Ruleset = ruleset.RulesetInfo;
|
Score.ScoreInfo.Ruleset = ruleset.RulesetInfo;
|
||||||
|
if (ruleset.RulesetInfo.ID != null)
|
||||||
Score.ScoreInfo.RulesetID = ruleset.RulesetInfo.ID.Value;
|
Score.ScoreInfo.RulesetID = ruleset.RulesetInfo.ID.Value;
|
||||||
Score.ScoreInfo.Mods = gameplayMods;
|
Score.ScoreInfo.Mods = gameplayMods;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user