1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:07:23 +08:00

Add test coverage of spinner with no bonus ticks

This commit is contained in:
Dean Herbert 2023-11-06 18:16:31 +09:00
parent aa6f14b024
commit 86cf0a36cf
No known key found for this signature in database

View File

@ -37,6 +37,12 @@ namespace osu.Game.Rulesets.Osu.Tests
AddSliderStep("Spin rate", 0.5, 5, 1, val => spinRate.Value = val); AddSliderStep("Spin rate", 0.5, 5, 1, val => spinRate.Value = val);
} }
[SetUpSteps]
public void SetUpSteps()
{
AddStep("Reset rate", () => spinRate.Value = 1);
}
[TestCase(true)] [TestCase(true)]
[TestCase(false)] [TestCase(false)]
public void TestVariousSpinners(bool autoplay) public void TestVariousSpinners(bool autoplay)
@ -47,6 +53,36 @@ namespace osu.Game.Rulesets.Osu.Tests
AddStep($"{term} Small", () => SetContents(_ => testSingle(7, autoplay))); AddStep($"{term} Small", () => SetContents(_ => testSingle(7, autoplay)));
} }
[Test]
public void TestSpinnerNoBonus()
{
AddStep("Set high spin rate", () => spinRate.Value = 5);
Spinner spinner;
AddStep("add spinner", () => SetContents(_ =>
{
spinner = new Spinner
{
StartTime = Time.Current,
EndTime = Time.Current + 750,
Samples = new List<HitSampleInfo>
{
new HitSampleInfo(HitSampleInfo.HIT_NORMAL)
}
};
spinner.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { OverallDifficulty = 0 });
return drawableSpinner = new TestDrawableSpinner(spinner, true, spinRate)
{
Anchor = Anchor.Centre,
Depth = depthIndex++,
Scale = new Vector2(0.75f)
};
}));
}
[Test] [Test]
public void TestSpinningSamplePitchShift() public void TestSpinningSamplePitchShift()
{ {