1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04:07:25 +08:00

Add test for object move

This commit is contained in:
cdwcgt 2022-09-08 23:47:55 +08:00
parent d1e27e8a69
commit 2e775e6886
No known key found for this signature in database
GPG Key ID: 144396D01095C3A2

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Linq; using System.Linq;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
@ -22,7 +20,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{ {
public class TestSceneSkinEditor : PlayerTestScene public class TestSceneSkinEditor : PlayerTestScene
{ {
private SkinEditor skinEditor; private SkinEditor skinEditor = null!;
protected override bool Autoplay => true; protected override bool Autoplay => true;
@ -54,7 +52,7 @@ namespace osu.Game.Tests.Visual.Gameplay
[Test] [Test]
public void TestEditComponent() public void TestEditComponent()
{ {
BarHitErrorMeter hitErrorMeter = null; BarHitErrorMeter hitErrorMeter = null!;
AddStep("select bar hit error blueprint", () => AddStep("select bar hit error blueprint", () =>
{ {
@ -65,6 +63,10 @@ namespace osu.Game.Tests.Visual.Gameplay
skinEditor.SelectedComponents.Add(blueprint.Item); skinEditor.SelectedComponents.Add(blueprint.Item);
}); });
AddStep("move by keyboard", () => InputManager.Key(Key.Right));
AddAssert("hitErrorMeter moved", () => hitErrorMeter.X != 0);
AddAssert("value is default", () => hitErrorMeter.JudgementLineThickness.IsDefault); AddAssert("value is default", () => hitErrorMeter.JudgementLineThickness.IsDefault);
AddStep("hover first slider", () => AddStep("hover first slider", () =>