mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 07:23:14 +08:00
Add failing test case
This commit is contained in:
parent
cf2238f683
commit
cd74f22e12
@ -6,11 +6,16 @@ using Moq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Toolbar;
|
||||
using osu.Game.Rulesets;
|
||||
using osuTK.Graphics;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Menus
|
||||
@ -95,6 +100,28 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
AddAssert("toolbar is visible", () => toolbar.State.Value == Visibility.Visible);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestScrollInput()
|
||||
{
|
||||
OsuScrollContainer scroll = null;
|
||||
|
||||
AddStep("add scroll layer", () => Add(scroll = new OsuScrollContainer
|
||||
{
|
||||
Depth = 1f,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = DrawHeight * 2,
|
||||
Colour = ColourInfo.GradientVertical(Color4.Gray, Color4.DarkGray),
|
||||
}
|
||||
}));
|
||||
|
||||
AddStep("hover toolbar", () => InputManager.MoveMouseTo(toolbar));
|
||||
AddStep("perform scroll", () => InputManager.ScrollVerticalBy(500));
|
||||
AddAssert("not scrolled", () => scroll.Current == 0);
|
||||
}
|
||||
|
||||
public class TestToolbar : Toolbar
|
||||
{
|
||||
public new Bindable<OverlayActivation> OverlayActivationMode => base.OverlayActivationMode as Bindable<OverlayActivation>;
|
||||
|
Loading…
Reference in New Issue
Block a user