1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 16:47:24 +08:00
osu-lazer/osu.Game.Tests/Visual/UserInterface/TestSceneRangeSlider.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.8 KiB
C#
Raw Normal View History

// 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.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
using osuTK;
namespace osu.Game.Tests.Visual.UserInterface
{
public class TestSceneRangeSlider : OsuTestScene
{
[Cached]
2022-11-26 20:59:05 +08:00
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Red);
private readonly BindableNumber<double> customStart = new BindableNumber<double>
{
MinValue = 0,
MaxValue = 100,
2022-11-26 20:59:05 +08:00
Precision = 0.1f
};
private readonly BindableNumber<double> customEnd = new BindableNumber<double>(100)
{
MinValue = 0,
MaxValue = 100,
Precision = 0.1f
};
[Test]
public void TestBasic()
{
AddStep("create Control", () => Child = new RangeSlider
{
Width = 200,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Scale = new Vector2(3),
LowerBound = customStart,
UpperBound = customEnd,
TooltipSuffix = "suffix",
NubWidth = Nub.HEIGHT * 2,
DefaultStringLowerBound = "Start",
2022-11-26 20:59:05 +08:00
DefaultStringUpperBound = "End",
MinRange = 10
});
AddStep("Test Range", () =>
{
customStart.Value = 50;
customEnd.Value = 75;
});
AddStep("Test nub pushing", () =>
{
customStart.Value = 90;
});
}
}
}