mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Fix intermittent failures in remaining test method
This commit is contained in:
@ -26,13 +26,37 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
|
|||||||
protected override bool AllowFail => true;
|
protected override bool AllowFail => true;
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSpinnerAutoCompleted() => CreateModTest(new ModTestData
|
public void TestSpinnerAutoCompleted()
|
||||||
|
{
|
||||||
|
DrawableSpinner spinner = null;
|
||||||
|
JudgementResult lastResult = null;
|
||||||
|
|
||||||
|
CreateModTest(new ModTestData
|
||||||
{
|
{
|
||||||
Mod = new OsuModSpunOut(),
|
Mod = new OsuModSpunOut(),
|
||||||
Autoplay = false,
|
Autoplay = false,
|
||||||
Beatmap = singleSpinnerBeatmap,
|
Beatmap = singleSpinnerBeatmap,
|
||||||
PassCondition = () => Player.ChildrenOfType<DrawableSpinner>().SingleOrDefault()?.Progress >= 1
|
PassCondition = () =>
|
||||||
|
{
|
||||||
|
// Bind to the first spinner's results for further tracking.
|
||||||
|
if (spinner == null)
|
||||||
|
{
|
||||||
|
// We only care about the first spinner we encounter for this test.
|
||||||
|
var nextSpinner = Player.ChildrenOfType<DrawableSpinner>().SingleOrDefault();
|
||||||
|
|
||||||
|
if (nextSpinner == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
lastResult = null;
|
||||||
|
|
||||||
|
spinner = nextSpinner;
|
||||||
|
spinner.OnNewResult += (o, result) => lastResult = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return lastResult?.Type == HitResult.Great;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
[TestCase(null)]
|
[TestCase(null)]
|
||||||
[TestCase(typeof(OsuModDoubleTime))]
|
[TestCase(typeof(OsuModDoubleTime))]
|
||||||
|
Reference in New Issue
Block a user