Add failing test coverage showing hit meters don't update when not visible

This commit is contained in:
Dean Herbert
2022-06-13 16:35:46 +09:00
parent 5b5caa88a0
commit 17eaf7bb5c
2 changed files with 36 additions and 6 deletions

View File

@ -142,6 +142,36 @@ namespace osu.Game.Tests.Visual.Gameplay
AddAssert("no circle added", () => !this.ChildrenOfType<ColourHitErrorMeter.HitErrorCircle>().Any());
}
[Test]
public void TestProcessingWhileHidden()
{
AddStep("OD 1", () => recreateDisplay(new OsuHitWindows(), 1));
AddStep("hide displays", () =>
{
foreach (var hitErrorMeter in this.ChildrenOfType<HitErrorMeter>())
hitErrorMeter.Hide();
});
AddRepeatStep("hit", () => newJudgement(), ColourHitErrorMeter.MAX_DISPLAYED_JUDGEMENTS * 2);
AddAssert("bars added", () => this.ChildrenOfType<BarHitErrorMeter.JudgementLine>().Any());
AddAssert("circle added", () => this.ChildrenOfType<ColourHitErrorMeter.HitErrorCircle>().Any());
AddUntilStep("wait for bars to disappear", () => !this.ChildrenOfType<BarHitErrorMeter.JudgementLine>().Any());
AddUntilStep("ensure max circles not exceeded", () =>
{
return this.ChildrenOfType<ColourHitErrorMeter>()
.All(m => m.ChildrenOfType<ColourHitErrorMeter.HitErrorCircle>().Count() <= ColourHitErrorMeter.MAX_DISPLAYED_JUDGEMENTS);
});
AddStep("show displays", () =>
{
foreach (var hitErrorMeter in this.ChildrenOfType<HitErrorMeter>())
hitErrorMeter.Show();
});
}
[Test]
public void TestClear()
{