mirror of https://github.com/ppy/osu
Test updates
This commit is contained in:
parent
e4b59c7317
commit
a5f866d95c
|
@ -1,28 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Testing;
|
||||
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;
|
||||
using osuTK.Input;
|
||||
using static osu.Game.Screens.Edit.Compose.Components.Timeline.TimelineHitObjectBlueprint;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Editing
|
||||
{
|
||||
public class TestSceneTimelineHitObjectBlueprint : TimelineTestScene
|
||||
{
|
||||
private Spinner spinner;
|
||||
private TimelineHitObjectBlueprint blueprint;
|
||||
|
||||
public TestSceneTimelineHitObjectBlueprint()
|
||||
{
|
||||
var spinner = new Spinner
|
||||
spinner = new Spinner
|
||||
{
|
||||
Position = new Vector2(256, 256),
|
||||
StartTime = -1000,
|
||||
|
@ -30,26 +29,22 @@ public TestSceneTimelineHitObjectBlueprint()
|
|||
};
|
||||
|
||||
spinner.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = 2 });
|
||||
Add(new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Size = new Vector2(0.5f),
|
||||
Child = _ = new DrawableSpinner(spinner)
|
||||
});
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
Clock.Seek(10000);
|
||||
}
|
||||
|
||||
public override Drawable CreateTestComponent() => blueprint = new TimelineHitObjectBlueprint(spinner);
|
||||
public override Drawable CreateTestComponent() => new TimelineHitObjectBlueprint(spinner);
|
||||
|
||||
[Test]
|
||||
public void TestDisallowZeroLengthSpinners()
|
||||
{
|
||||
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue