mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 16:43:52 +09:00
Add test coverage
This commit is contained in:
@ -11,6 +11,7 @@ using osu.Game.Graphics.Containers;
|
|||||||
using osu.Game.Graphics.Cursor;
|
using osu.Game.Graphics.Cursor;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
|
using osu.Game.Skinning;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
|
|
||||||
@ -221,6 +222,31 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
confirmExited();
|
confirmExited();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestPauseSoundLoop()
|
||||||
|
{
|
||||||
|
AddStep("seek before gameplay", () => Player.GameplayClockContainer.Seek(-5000));
|
||||||
|
|
||||||
|
SkinnableSound getLoop() => Player.ChildrenOfType<PauseOverlay>().FirstOrDefault()?.ChildrenOfType<SkinnableSound>().FirstOrDefault();
|
||||||
|
|
||||||
|
pauseAndConfirm();
|
||||||
|
AddAssert("loop is playing", () => getLoop().IsPlaying);
|
||||||
|
|
||||||
|
resumeAndConfirm();
|
||||||
|
AddUntilStep("loop is stopped", () => !getLoop().IsPlaying);
|
||||||
|
|
||||||
|
AddUntilStep("pause again", () =>
|
||||||
|
{
|
||||||
|
Player.Pause();
|
||||||
|
return !Player.GameplayClockContainer.GameplayClock.IsRunning;
|
||||||
|
});
|
||||||
|
|
||||||
|
AddAssert("loop is playing", () => getLoop().IsPlaying);
|
||||||
|
|
||||||
|
resumeAndConfirm();
|
||||||
|
AddUntilStep("loop is stopped", () => !getLoop().IsPlaying);
|
||||||
|
}
|
||||||
|
|
||||||
private void pauseAndConfirm()
|
private void pauseAndConfirm()
|
||||||
{
|
{
|
||||||
pause();
|
pause();
|
||||||
|
Reference in New Issue
Block a user