1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-18 04:07:44 +08:00

Fix regression in TestSceneSongProgress

This commit is contained in:
Dean Herbert 2022-09-21 23:26:25 +09:00
parent 4492a26b59
commit 1ef09f2ae1

View File

@ -1,8 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions;
@ -51,13 +51,14 @@ namespace osu.Game.Tests.Visual.Gameplay
[Test]
public void TestToggleSeeking()
{
DefaultSongProgress getDefaultProgress() => this.ChildrenOfType<DefaultSongProgress>().Single();
void applyToDefaultProgress(Action<DefaultSongProgress> action) =>
this.ChildrenOfType<DefaultSongProgress>().ForEach(action);
AddStep("allow seeking", () => getDefaultProgress().AllowSeeking.Value = true);
AddStep("hide graph", () => getDefaultProgress().ShowGraph.Value = false);
AddStep("disallow seeking", () => getDefaultProgress().AllowSeeking.Value = false);
AddStep("allow seeking", () => getDefaultProgress().AllowSeeking.Value = true);
AddStep("show graph", () => getDefaultProgress().ShowGraph.Value = true);
AddStep("allow seeking", () => applyToDefaultProgress(s => s.AllowSeeking.Value = true));
AddStep("hide graph", () => applyToDefaultProgress(s => s.ShowGraph.Value = false));
AddStep("disallow seeking", () => applyToDefaultProgress(s => s.AllowSeeking.Value = false));
AddStep("allow seeking", () => applyToDefaultProgress(s => s.AllowSeeking.Value = true));
AddStep("show graph", () => applyToDefaultProgress(s => s.ShowGraph.Value = true));
}
private void setHitObjects()