1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 15:27:24 +08:00

Rename method to be more specific and standardise setBeatmap calls

This commit is contained in:
Dean Herbert 2022-08-17 23:03:39 +09:00
parent 553ae4781f
commit d40d09a544

View File

@ -63,6 +63,8 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
[Test] [Test]
public void TestInitialState() public void TestInitialState()
{ {
AddStep("set beatmap", () => setBeatmap());
AddStep("create mascot", () => SetContents(_ => new DrawableTaikoMascot { RelativeSizeAxes = Axes.Both })); AddStep("create mascot", () => SetContents(_ => new DrawableTaikoMascot { RelativeSizeAxes = Axes.Both }));
AddAssert("mascot initially idle", () => allMascotsIn(TaikoMascotAnimationState.Idle)); AddAssert("mascot initially idle", () => allMascotsIn(TaikoMascotAnimationState.Idle));
@ -87,7 +89,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
[Test] [Test]
public void TestIdleState() public void TestIdleState()
{ {
prepareTest(false); prepareDrawableRulesetAndBeatmap(false);
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Idle); assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Idle);
assertStateAfterResult(new JudgementResult(new Hit.StrongNestedHit(), new TaikoStrongJudgement()) { Type = HitResult.IgnoreMiss }, TaikoMascotAnimationState.Idle); assertStateAfterResult(new JudgementResult(new Hit.StrongNestedHit(), new TaikoStrongJudgement()) { Type = HitResult.IgnoreMiss }, TaikoMascotAnimationState.Idle);
@ -96,7 +98,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
[Test] [Test]
public void TestKiaiState() public void TestKiaiState()
{ {
prepareTest(true); prepareDrawableRulesetAndBeatmap(true);
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Ok }, TaikoMascotAnimationState.Kiai); assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Ok }, TaikoMascotAnimationState.Kiai);
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoStrongJudgement()) { Type = HitResult.IgnoreMiss }, TaikoMascotAnimationState.Kiai); assertStateAfterResult(new JudgementResult(new Hit(), new TaikoStrongJudgement()) { Type = HitResult.IgnoreMiss }, TaikoMascotAnimationState.Kiai);
@ -106,7 +108,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
[Test] [Test]
public void TestMissState() public void TestMissState()
{ {
prepareTest(false); prepareDrawableRulesetAndBeatmap(false);
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Idle); assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Idle);
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Miss }, TaikoMascotAnimationState.Fail); assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Miss }, TaikoMascotAnimationState.Fail);
@ -118,9 +120,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
[TestCase(false)] [TestCase(false)]
public void TestClearStateOnComboMilestone(bool kiai) public void TestClearStateOnComboMilestone(bool kiai)
{ {
AddStep("set beatmap", () => setBeatmap(kiai)); prepareDrawableRulesetAndBeatmap(kiai);
prepareTest(kiai);
AddRepeatStep("reach 49 combo", () => applyNewResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Great }), 49); AddRepeatStep("reach 49 combo", () => applyNewResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Great }), 49);
@ -131,7 +131,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
[TestCase(false, TaikoMascotAnimationState.Idle)] [TestCase(false, TaikoMascotAnimationState.Idle)]
public void TestClearStateOnClearedSwell(bool kiai, TaikoMascotAnimationState expectedStateAfterClear) public void TestClearStateOnClearedSwell(bool kiai, TaikoMascotAnimationState expectedStateAfterClear)
{ {
prepareTest(kiai); prepareDrawableRulesetAndBeatmap(kiai);
assertStateAfterResult(new JudgementResult(new Swell(), new TaikoSwellJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Clear); assertStateAfterResult(new JudgementResult(new Swell(), new TaikoSwellJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Clear);
AddUntilStep($"state reverts to {expectedStateAfterClear.ToString().ToLowerInvariant()}", () => allMascotsIn(expectedStateAfterClear)); AddUntilStep($"state reverts to {expectedStateAfterClear.ToString().ToLowerInvariant()}", () => allMascotsIn(expectedStateAfterClear));
@ -165,7 +165,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
scoreProcessor.ApplyBeatmap(Beatmap.Value.Beatmap); scoreProcessor.ApplyBeatmap(Beatmap.Value.Beatmap);
} }
private void prepareTest(bool kiai) private void prepareDrawableRulesetAndBeatmap(bool kiai)
{ {
AddStep("set beatmap", () => setBeatmap(kiai)); AddStep("set beatmap", () => setBeatmap(kiai));