1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 19:32:58 +08:00
osu-lazer/osu.Game.Rulesets.Osu.Tests/Editor/TestSceneOsuEditorSelectInvalidPath.cs

49 lines
1.6 KiB
C#
Raw Normal View History

2021-04-13 17:35:12 +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-06-17 15:37:17 +08:00
#nullable disable
2021-04-13 17:35:12 +08:00
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Tests.Beatmaps;
using osu.Game.Tests.Visual;
using osuTK;
namespace osu.Game.Rulesets.Osu.Tests.Editor
{
2022-11-24 13:32:20 +08:00
public partial class TestSceneOsuEditorSelectInvalidPath : EditorTestScene
2021-04-13 17:35:12 +08:00
{
protected override Ruleset CreateEditorRuleset() => new OsuRuleset();
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) => new TestBeatmap(ruleset, false);
[Test]
public void TestSelectDoesNotModify()
{
Slider slider = new Slider { StartTime = 0, Position = new Vector2(320, 40) };
PathControlPoint[] points =
{
new PathControlPoint(new Vector2(0), PathType.PerfectCurve),
new PathControlPoint(new Vector2(-100, 0)),
new PathControlPoint(new Vector2(100, 20))
};
int preSelectVersion = -1;
AddStep("add slider", () =>
{
slider.Path = new SliderPath(points);
EditorBeatmap.Add(slider);
preSelectVersion = slider.Path.Version.Value;
});
AddStep("select added slider", () => EditorBeatmap.SelectedHitObjects.Add(slider));
AddAssert("slider same path", () => slider.Path.Version.Value == preSelectVersion);
}
}
}