1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00

Add test coverage of new traversal keys

This commit is contained in:
Dean Herbert 2022-05-14 03:01:42 +09:00
parent c4871ebcf4
commit a346456daf

View File

@ -28,6 +28,51 @@ namespace osu.Game.Tests.Visual.Editing
return beatmap; return beatmap;
} }
[Test]
public void TestSeekToFirst()
{
pressAndCheckTime(Key.Z, 2170);
pressAndCheckTime(Key.Z, 0);
pressAndCheckTime(Key.Z, 2170);
AddAssert("track not running", () => !EditorClock.IsRunning);
}
[Test]
public void TestRestart()
{
pressAndCheckTime(Key.V, 227170);
AddAssert("track not running", () => !EditorClock.IsRunning);
AddStep("press X", () => InputManager.Key(Key.X));
AddAssert("track running", () => EditorClock.IsRunning);
AddAssert("time restarted", () => EditorClock.CurrentTime < 100000);
}
[Test]
public void TestPauseResume()
{
AddAssert("track not running", () => !EditorClock.IsRunning);
AddStep("press C", () => InputManager.Key(Key.C));
AddAssert("track running", () => EditorClock.IsRunning);
AddStep("press C", () => InputManager.Key(Key.C));
AddAssert("track not running", () => !EditorClock.IsRunning);
}
[Test]
public void TestSeekToLast()
{
pressAndCheckTime(Key.V, 227170);
pressAndCheckTime(Key.V, 229170);
pressAndCheckTime(Key.V, 227170);
AddAssert("track not running", () => !EditorClock.IsRunning);
}
[Test] [Test]
public void TestSnappedSeeking() public void TestSnappedSeeking()
{ {