osu/osu.Game.Tests/Visual/Editing/TestSceneTimelineHitObjectB...

51 lines
1.7 KiB
C#
Raw Normal View History

2021-01-21 20:14:24 +00:00
using System.Linq;
2021-01-21 16:54:26 +00:00
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2021-01-21 20:14:24 +00:00
using osu.Framework.Graphics.Shapes;
using osu.Framework.Testing;
2021-01-21 16:54:26 +00:00
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Screens.Edit.Compose.Components.Timeline;
using osuTK;
2021-01-21 20:14:24 +00:00
using osuTK.Input;
using static osu.Game.Screens.Edit.Compose.Components.Timeline.TimelineHitObjectBlueprint;
2021-01-21 16:54:26 +00:00
namespace osu.Game.Tests.Visual.Editing
{
public class TestSceneTimelineHitObjectBlueprint : TimelineTestScene
{
private Spinner spinner;
public TestSceneTimelineHitObjectBlueprint()
{
2021-01-21 20:14:24 +00:00
spinner = new Spinner
2021-01-21 16:54:26 +00:00
{
Position = new Vector2(256, 256),
StartTime = -1000,
EndTime = 2000
};
spinner.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = 2 });
}
2021-01-21 20:14:24 +00:00
public override Drawable CreateTestComponent() => new TimelineHitObjectBlueprint(spinner);
2021-01-21 16:54:26 +00:00
[Test]
public void TestDisallowZeroLengthSpinners()
{
2021-01-21 20:14:24 +00:00
DragBar dragBar = this.ChildrenOfType<DragBar>().First();
Circle circle = this.ChildrenOfType<Circle>().First();
InputManager.MoveMouseTo(dragBar.ScreenSpaceDrawQuad.TopRight);
AddStep("drag dragbar to hit object", () =>
{
InputManager.PressButton(MouseButton.Left);
InputManager.MoveMouseTo(circle.ScreenSpaceDrawQuad.TopLeft);
InputManager.ReleaseButton(MouseButton.Left);
});
2021-01-21 16:54:26 +00:00
}
}
}