1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 23:42:54 +08:00

Add test steps demonstrating failure case

This commit is contained in:
Bartłomiej Dach 2024-09-30 08:38:11 +02:00
parent a258059d43
commit 3fac9baa9f
No known key found for this signature in database

View File

@ -175,6 +175,20 @@ namespace osu.Game.Tests.Visual.SongSelect
increaseModSpeed();
AddAssert("adaptive speed still active", () => songSelect!.Mods.Value.First() is ModAdaptiveSpeed);
OsuModDoubleTime dtWithAdjustPitch = new OsuModDoubleTime
{
SpeedChange = { Value = 1.05 },
AdjustPitch = { Value = true },
};
changeMods(dtWithAdjustPitch);
decreaseModSpeed();
AddAssert("no mods selected", () => songSelect!.Mods.Value.Count == 0);
decreaseModSpeed();
AddAssert("half time activated at 0.95x", () => songSelect!.Mods.Value.OfType<ModHalfTime>().Single().SpeedChange.Value, () => Is.EqualTo(0.95).Within(0.005));
AddAssert("half time has adjust pitch active", () => songSelect!.Mods.Value.OfType<ModHalfTime>().Single().AdjustPitch.Value, () => Is.True);
void increaseModSpeed() => AddStep("increase mod speed", () =>
{
InputManager.PressKey(Key.ControlLeft);