Move simulated drain to separate test case

Having it on at all times was causing other tests to fail.
This commit is contained in:
Bartłomiej Dach 2024-01-11 10:04:37 +01:00
parent 5d6f767dbd
commit 861080d3ae
No known key found for this signature in database
1 changed files with 8 additions and 3 deletions

View File

@ -7,6 +7,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Testing;
using osu.Framework.Threading;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Judgements;
@ -160,10 +161,14 @@ private void applyPerfectHit()
});
}
protected override void Update()
[Test]
public void TestSimulateDrain()
{
base.Update();
healthProcessor.Health.Value -= 0.0001f * Time.Elapsed;
ScheduledDelegate del = null!;
AddStep("simulate drain", () => del = Scheduler.AddDelayed(() => healthProcessor.Health.Value -= 0.00025f * Time.Elapsed, 0, true));
AddUntilStep("wait until zero", () => healthProcessor.Health.Value == 0);
AddStep("cancel drain", () => del.Cancel());
}
}
}