mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 14:12:56 +08:00
Update TestSceneSongProgress
to properly work with new implementation
This commit is contained in:
parent
1e5dd9165a
commit
04c0a5d728
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
@ -38,28 +39,38 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
AddStep("reset clock", () => gameplayClockContainer.Reset());
|
AddStep("reset clock", () => gameplayClockContainer.Reset());
|
||||||
AddStep("set hit objects", setHitObjects);
|
AddStep("set hit objects", setHitObjects);
|
||||||
|
AddStep("hook seeking", () =>
|
||||||
|
{
|
||||||
|
applyToDefaultProgress(d => d.ChildrenOfType<SongProgressBar>().Single().OnSeek += t => gameplayClockContainer.Seek(t));
|
||||||
|
applyToArgonProgress(d => d.ChildrenOfType<ArgonSongProgressBar>().Single().OnSeek += t => gameplayClockContainer.Seek(t));
|
||||||
|
});
|
||||||
|
AddStep("seek to intro", () => gameplayClockContainer.Seek(skip_target_time));
|
||||||
|
AddStep("start", gameplayClockContainer.Start);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDisplay()
|
public void TestBasic()
|
||||||
{
|
{
|
||||||
AddStep("seek to intro", () => gameplayClockContainer.Seek(skip_target_time));
|
AddToggleStep("toggle seeking", b =>
|
||||||
AddStep("start", gameplayClockContainer.Start);
|
{
|
||||||
|
applyToDefaultProgress(s => s.Interactive.Value = b);
|
||||||
|
applyToArgonProgress(s => s.Interactive.Value = b);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddToggleStep("toggle graph", b =>
|
||||||
|
{
|
||||||
|
applyToDefaultProgress(s => s.ShowGraph.Value = b);
|
||||||
|
applyToArgonProgress(s => s.ShowGraph.Value = b);
|
||||||
|
});
|
||||||
|
|
||||||
AddStep("stop", gameplayClockContainer.Stop);
|
AddStep("stop", gameplayClockContainer.Stop);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
private void applyToArgonProgress(Action<ArgonSongProgress> action) =>
|
||||||
public void TestToggleSeeking()
|
this.ChildrenOfType<ArgonSongProgress>().ForEach(action);
|
||||||
{
|
|
||||||
void applyToDefaultProgress(Action<DefaultSongProgress> action) =>
|
|
||||||
this.ChildrenOfType<DefaultSongProgress>().ForEach(action);
|
|
||||||
|
|
||||||
AddStep("allow seeking", () => applyToDefaultProgress(s => s.Interactive.Value = true));
|
private void applyToDefaultProgress(Action<DefaultSongProgress> action) =>
|
||||||
AddStep("hide graph", () => applyToDefaultProgress(s => s.ShowGraph.Value = false));
|
this.ChildrenOfType<DefaultSongProgress>().ForEach(action);
|
||||||
AddStep("disallow seeking", () => applyToDefaultProgress(s => s.Interactive.Value = false));
|
|
||||||
AddStep("allow seeking", () => applyToDefaultProgress(s => s.Interactive.Value = true));
|
|
||||||
AddStep("show graph", () => applyToDefaultProgress(s => s.ShowGraph.Value = true));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setHitObjects()
|
private void setHitObjects()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user