1
0
mirror of https://github.com/ppy/osu synced 2025-03-30 15:17:22 +00:00

Change boolean argument to HitResult instead

This commit is contained in:
Salman Ahmed 2022-04-27 00:05:15 +03:00
parent cccc9d7d39
commit 1676c2c3f6

View File

@ -174,8 +174,9 @@ namespace osu.Game.Tests.Gameplay
AddAssert("failed", () => processor.HasFailed); AddAssert("failed", () => processor.HasFailed);
} }
[Test] [TestCase(HitResult.Miss)]
public void TestMultipleFailConditions([Values] bool applyFirstCondition) [TestCase(HitResult.Meh)]
public void TestMultipleFailConditions(HitResult resultApplied)
{ {
var beatmap = createBeatmap(0, 1000); var beatmap = createBeatmap(0, 1000);
createProcessor(beatmap); createProcessor(beatmap);
@ -189,11 +190,7 @@ namespace osu.Game.Tests.Gameplay
AddStep("apply perfect hit result", () => processor.ApplyResult(new JudgementResult(beatmap.HitObjects[0], new Judgement()) { Type = HitResult.Perfect })); AddStep("apply perfect hit result", () => processor.ApplyResult(new JudgementResult(beatmap.HitObjects[0], new Judgement()) { Type = HitResult.Perfect }));
AddAssert("not failed", () => !processor.HasFailed); AddAssert("not failed", () => !processor.HasFailed);
if (applyFirstCondition) AddStep($"apply {resultApplied.ToString().ToLower()} hit result", () => processor.ApplyResult(new JudgementResult(beatmap.HitObjects[0], new Judgement()) { Type = HitResult.Miss }));
AddStep("apply miss hit result", () => processor.ApplyResult(new JudgementResult(beatmap.HitObjects[0], new Judgement()) { Type = HitResult.Miss }));
else
AddStep("apply meh hit result", () => processor.ApplyResult(new JudgementResult(beatmap.HitObjects[0], new Judgement()) { Type = HitResult.Meh }));
AddAssert("failed", () => processor.HasFailed); AddAssert("failed", () => processor.HasFailed);
} }