2022-12-16 00:35:54 +08:00
|
|
|
|
// 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.
|
|
|
|
|
|
2022-12-16 09:44:07 +08:00
|
|
|
|
using System.Linq;
|
2022-12-16 00:35:54 +08:00
|
|
|
|
using NUnit.Framework;
|
2022-12-16 09:44:07 +08:00
|
|
|
|
using osu.Framework.Testing;
|
2022-12-16 00:35:54 +08:00
|
|
|
|
using osu.Game.Rulesets;
|
|
|
|
|
using osu.Game.Rulesets.Osu;
|
2022-12-16 09:44:07 +08:00
|
|
|
|
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
|
2022-12-16 00:35:54 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Editing
|
|
|
|
|
{
|
|
|
|
|
public partial class TestScenePreviewTime : EditorTestScene
|
|
|
|
|
{
|
|
|
|
|
protected override Ruleset CreateEditorRuleset() => new OsuRuleset();
|
|
|
|
|
|
|
|
|
|
[Test]
|
2022-12-16 09:44:07 +08:00
|
|
|
|
public void TestSceneSetPreviewTimingPoint()
|
2022-12-16 00:35:54 +08:00
|
|
|
|
{
|
|
|
|
|
AddStep("seek to 1000", () => EditorClock.Seek(1000));
|
|
|
|
|
AddAssert("time is 1000", () => EditorClock.CurrentTime == 1000);
|
2022-12-16 09:48:56 +08:00
|
|
|
|
AddStep("set current time as preview point", () => Editor.SetCurrentTimeAsPreview());
|
2022-12-16 00:35:54 +08:00
|
|
|
|
AddAssert("preview time is 1000", () => EditorBeatmap.PreviewTime.Value == 1000);
|
|
|
|
|
}
|
2022-12-16 09:44:07 +08:00
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestScenePreviewTimeline()
|
|
|
|
|
{
|
|
|
|
|
AddStep("set preview time to -1", () => EditorBeatmap.PreviewTime.Value = -1);
|
|
|
|
|
AddAssert("preview time line should not show", () => Editor.ChildrenOfType<PreviewTimePart>().Single().Alpha == 0);
|
|
|
|
|
AddStep("set preview time to 1000", () => EditorBeatmap.PreviewTime.Value = 1000);
|
|
|
|
|
AddAssert("preview time line should show", () => Editor.ChildrenOfType<PreviewTimePart>().Single().Alpha == 1);
|
|
|
|
|
}
|
2022-12-16 00:35:54 +08:00
|
|
|
|
}
|
|
|
|
|
}
|