mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 09:43:10 +08:00
Remove usage of player settings in TestSceneSettingsToolboxGroup
This commit is contained in:
parent
96ea4ee7b3
commit
beb86a7f7c
@ -4,12 +4,11 @@
|
|||||||
using System.Linq;
|
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.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Graphics.UserInterfaceV2;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Screens.Play.HUD;
|
using osu.Game.Overlays.Settings;
|
||||||
using osu.Game.Screens.Play.PlayerSettings;
|
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.UserInterface
|
namespace osu.Game.Tests.Visual.UserInterface
|
||||||
@ -17,45 +16,39 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneSettingsToolboxGroup : OsuManualInputManagerTestScene
|
public class TestSceneSettingsToolboxGroup : OsuManualInputManagerTestScene
|
||||||
{
|
{
|
||||||
public TestSceneSettingsToolboxGroup()
|
private SettingsToolboxGroup group;
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void SetUp() => Schedule(() =>
|
||||||
{
|
{
|
||||||
ExampleContainer container;
|
Child = group = new SettingsToolboxGroup("example")
|
||||||
|
|
||||||
Add(new PlayerSettingsOverlay
|
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Children = new Drawable[]
|
||||||
Origin = Anchor.TopRight,
|
{
|
||||||
State = { Value = Visibility.Visible }
|
new RoundedButton
|
||||||
});
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
Add(container = new ExampleContainer());
|
Text = @"Button",
|
||||||
|
Enabled = { Value = true },
|
||||||
AddStep(@"Add button", () => container.Add(new TriangleButton
|
},
|
||||||
{
|
new OsuCheckbox
|
||||||
RelativeSizeAxes = Axes.X,
|
{
|
||||||
Text = @"Button",
|
LabelText = @"Checkbox",
|
||||||
}));
|
},
|
||||||
|
new OutlinedTextBox
|
||||||
AddStep(@"Add checkbox", () => container.Add(new PlayerCheckbox
|
{
|
||||||
{
|
RelativeSizeAxes = Axes.X,
|
||||||
LabelText = "Checkbox",
|
Height = 30,
|
||||||
}));
|
PlaceholderText = @"Textbox",
|
||||||
|
}
|
||||||
AddStep(@"Add textbox", () => container.Add(new FocusedTextBox
|
},
|
||||||
{
|
};
|
||||||
RelativeSizeAxes = Axes.X,
|
});
|
||||||
Height = 30,
|
|
||||||
PlaceholderText = "Textbox",
|
|
||||||
HoldFocus = false,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestClickExpandButtonMultipleTimes()
|
public void TestClickExpandButtonMultipleTimes()
|
||||||
{
|
{
|
||||||
SettingsToolboxGroup group = null;
|
AddAssert("group expanded by default", () => group.Expanded.Value);
|
||||||
|
|
||||||
AddAssert("group expanded by default", () => (group = this.ChildrenOfType<SettingsToolboxGroup>().First()).Expanded.Value);
|
|
||||||
AddStep("click expand button multiple times", () =>
|
AddStep("click expand button multiple times", () =>
|
||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(group.ChildrenOfType<IconButton>().Single());
|
InputManager.MoveMouseTo(group.ChildrenOfType<IconButton>().Single());
|
||||||
@ -65,13 +58,5 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
});
|
});
|
||||||
AddAssert("group contracted", () => !group.Expanded.Value);
|
AddAssert("group contracted", () => !group.Expanded.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ExampleContainer : PlayerSettingsGroup
|
|
||||||
{
|
|
||||||
public ExampleContainer()
|
|
||||||
: base("example")
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user