1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 15:43:21 +08:00

Ensure there is at least one sample during rate assertion

This commit is contained in:
Salman Ahmed 2022-03-02 23:40:14 +03:00
parent cbb8dc2891
commit a812ed4462

View File

@ -83,9 +83,7 @@ namespace osu.Game.Tests.Visual.Gameplay
createPlayerTest(true); createPlayerTest(true);
AddAssert("sample playback rate matches mod rates", () => allStoryboardSamples.All(sound => AddAssert("sample playback rate matches mod rates", () => allStoryboardSamples.All(sound =>
{ sound.ChildrenOfType<DrawableSample>().First().AggregateFrequency.Value == expectedRate));
return sound.ChildrenOfType<DrawableSample>().All(s => s.AggregateFrequency.Value == expectedRate);
}));
} }
[TestCase(typeof(ModWindUp), 0.5, 2)] [TestCase(typeof(ModWindUp), 0.5, 2)]
@ -113,9 +111,7 @@ namespace osu.Game.Tests.Visual.Gameplay
}); });
AddAssert("sample playback rate matches mod rates", () => allStoryboardSamples.All(sound => AddAssert("sample playback rate matches mod rates", () => allStoryboardSamples.All(sound =>
{ sound.ChildrenOfType<DrawableSample>().First().AggregateFrequency.Value == gameplayMod.SpeedChange.Value));
return sound.ChildrenOfType<DrawableSample>().All(s => s.AggregateFrequency.Value == gameplayMod.SpeedChange.Value);
}));
} }
private void createPlayerTest(bool skipIntro = false) private void createPlayerTest(bool skipIntro = false)