mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:33:21 +08:00
Restructure tests not to call each other
Bit weird to have tests call other tests. Private helper methods is better, if unavoidable.
This commit is contained in:
parent
db34fa99b1
commit
5a5b0ed4ef
@ -26,8 +26,10 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void TestDrumroll()
|
||||
public void TestDrumroll([Values] bool withKiai)
|
||||
{
|
||||
AddStep("set up beatmap", () => setUpBeatmap(withKiai));
|
||||
|
||||
AddStep("Drum roll", () => SetContents(_ =>
|
||||
{
|
||||
var hoc = new ScrollingHitObjectContainer();
|
||||
@ -57,14 +59,6 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
||||
}));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDrumrollKiai()
|
||||
{
|
||||
AddStep("Create beatmap", createBeatmap);
|
||||
|
||||
TestDrumroll();
|
||||
}
|
||||
|
||||
private DrumRoll createDrumRollAtCurrentTime(bool strong = false)
|
||||
{
|
||||
var drumroll = new DrumRoll
|
||||
@ -82,12 +76,14 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
||||
return drumroll;
|
||||
}
|
||||
|
||||
private void createBeatmap()
|
||||
private void setUpBeatmap(bool withKiai)
|
||||
{
|
||||
var controlPointInfo = new ControlPointInfo();
|
||||
|
||||
controlPointInfo.Add(0, new TimingControlPoint { BeatLength = 500 });
|
||||
controlPointInfo.Add(0, new EffectControlPoint { KiaiMode = true });
|
||||
|
||||
if (withKiai)
|
||||
controlPointInfo.Add(0, new EffectControlPoint { KiaiMode = true });
|
||||
|
||||
Beatmap.Value = CreateWorkingBeatmap(new Beatmap
|
||||
{
|
||||
|
@ -22,7 +22,37 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
||||
private GameplayState gameplayState = TestGameplayState.Create(new TaikoRuleset());
|
||||
|
||||
[Test]
|
||||
public void TestHits()
|
||||
public void TestHits([Values] bool withKiai)
|
||||
{
|
||||
AddStep("Create beatmap", () => setUpBeatmap(withKiai));
|
||||
addHitSteps();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestHitAnimationSlow()
|
||||
{
|
||||
AddStep("Create beatmap", () => setUpBeatmap(false));
|
||||
|
||||
AddStep("Reset combo", () => gameplayState.ScoreProcessor.Combo.Value = 0);
|
||||
|
||||
AddRepeatStep("Increase combo", () => gameplayState.ScoreProcessor.Combo.Value++, 50);
|
||||
|
||||
addHitSteps();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestHitAnimationFast()
|
||||
{
|
||||
AddStep("Create beatmap", () => setUpBeatmap(false));
|
||||
|
||||
AddStep("Reset combo", () => gameplayState.ScoreProcessor.Combo.Value = 0);
|
||||
|
||||
AddRepeatStep("Increase combo", () => gameplayState.ScoreProcessor.Combo.Value++, 150);
|
||||
|
||||
addHitSteps();
|
||||
}
|
||||
|
||||
private void addHitSteps()
|
||||
{
|
||||
AddStep("Centre hit", () => SetContents(_ => new DrawableHit(createHitAtCurrentTime())
|
||||
{
|
||||
@ -49,38 +79,6 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
||||
}));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestHitKiai()
|
||||
{
|
||||
AddStep("Create beatmap", () => createBeatmap(true));
|
||||
|
||||
TestHits();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestHitAnimationSlow()
|
||||
{
|
||||
AddStep("Create beatmap", () => createBeatmap(false));
|
||||
|
||||
AddStep("Reset combo", () => gameplayState.ScoreProcessor.Combo.Value = 0);
|
||||
|
||||
AddRepeatStep("Increase combo", () => gameplayState.ScoreProcessor.Combo.Value++, 50);
|
||||
|
||||
TestHits();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestHitAnimationFast()
|
||||
{
|
||||
AddStep("Create beatmap", () => createBeatmap(false));
|
||||
|
||||
AddStep("Reset combo", () => gameplayState.ScoreProcessor.Combo.Value = 0);
|
||||
|
||||
AddRepeatStep("Increase combo", () => gameplayState.ScoreProcessor.Combo.Value++, 150);
|
||||
|
||||
TestHits();
|
||||
}
|
||||
|
||||
private Hit createHitAtCurrentTime(bool strong = false, bool rim = false)
|
||||
{
|
||||
var hit = new Hit
|
||||
@ -95,13 +93,13 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
|
||||
return hit;
|
||||
}
|
||||
|
||||
private void createBeatmap(bool includeKiai)
|
||||
private void setUpBeatmap(bool withKiai)
|
||||
{
|
||||
var controlPointInfo = new ControlPointInfo();
|
||||
|
||||
controlPointInfo.Add(0, new TimingControlPoint { BeatLength = 500 });
|
||||
|
||||
if (includeKiai)
|
||||
if (withKiai)
|
||||
controlPointInfo.Add(0, new EffectControlPoint { KiaiMode = true });
|
||||
|
||||
Beatmap.Value = CreateWorkingBeatmap(new Beatmap
|
||||
|
Loading…
Reference in New Issue
Block a user