mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Add failing test case
This commit is contained in:
@ -1,17 +1,21 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Screens.Play.HUD;
|
using osu.Game.Screens.Play.HUD;
|
||||||
using osu.Game.Screens.Play.PlayerSettings;
|
using osu.Game.Screens.Play.PlayerSettings;
|
||||||
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.UserInterface
|
namespace osu.Game.Tests.Visual.UserInterface
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneSettingsToolboxGroup : OsuTestScene
|
public class TestSceneSettingsToolboxGroup : OsuManualInputManagerTestScene
|
||||||
{
|
{
|
||||||
public TestSceneSettingsToolboxGroup()
|
public TestSceneSettingsToolboxGroup()
|
||||||
{
|
{
|
||||||
@ -46,6 +50,22 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestClickExpandButtonMultipleTimes()
|
||||||
|
{
|
||||||
|
SettingsToolboxGroup group = null;
|
||||||
|
|
||||||
|
AddAssert("group expanded by default", () => (group = this.ChildrenOfType<SettingsToolboxGroup>().First()).Expanded.Value);
|
||||||
|
AddStep("click expand button multiple times", () =>
|
||||||
|
{
|
||||||
|
InputManager.MoveMouseTo(group.ChildrenOfType<IconButton>().Single());
|
||||||
|
Scheduler.AddDelayed(() => InputManager.Click(MouseButton.Left), 100);
|
||||||
|
Scheduler.AddDelayed(() => InputManager.Click(MouseButton.Left), 200);
|
||||||
|
Scheduler.AddDelayed(() => InputManager.Click(MouseButton.Left), 300);
|
||||||
|
});
|
||||||
|
AddAssert("group contracted", () => !group.Expanded.Value);
|
||||||
|
}
|
||||||
|
|
||||||
private class ExampleContainer : PlayerSettingsGroup
|
private class ExampleContainer : PlayerSettingsGroup
|
||||||
{
|
{
|
||||||
public ExampleContainer()
|
public ExampleContainer()
|
||||||
|
Reference in New Issue
Block a user