1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 16:47:46 +08:00

Fix cross-test data dependency by recreating slider every time

This commit is contained in:
Bartłomiej Dach 2023-10-26 12:11:25 +02:00
parent 96437c4518
commit 89fec95b01
No known key found for this signature in database
2 changed files with 20 additions and 24 deletions

View File

@ -18,26 +18,24 @@ namespace osu.Game.Tests.Visual.UserInterface
[Cached]
private OverlayColourProvider colourProvider { get; set; } = new OverlayColourProvider(OverlayColourScheme.Purple);
private readonly BindableDouble current = new BindableDouble(5)
{
Precision = 0.1,
MinValue = 0,
MaxValue = 15
};
private RoundedSliderBar<double> slider = null!;
[BackgroundDependencyLoader]
private void load()
[SetUpSteps]
public void SetUpSteps()
{
Child = slider = new RoundedSliderBar<double>
AddStep("create slider", () => Child = slider = new RoundedSliderBar<double>
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Current = current,
Current = new BindableDouble(5)
{
Precision = 0.1,
MinValue = 0,
MaxValue = 15
},
RelativeSizeAxes = Axes.X,
Width = 0.4f
};
});
}
[Test]

View File

@ -18,26 +18,24 @@ namespace osu.Game.Tests.Visual.UserInterface
[Cached]
private OverlayColourProvider colourProvider { get; set; } = new OverlayColourProvider(OverlayColourScheme.Purple);
private readonly BindableDouble current = new BindableDouble(5)
{
Precision = 0.1,
MinValue = 0,
MaxValue = 15
};
private ShearedSliderBar<double> slider = null!;
[BackgroundDependencyLoader]
private void load()
[SetUpSteps]
public void SetUpSteps()
{
Child = slider = new ShearedSliderBar<double>
AddStep("create slider", () => Child = slider = new ShearedSliderBar<double>
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Current = current,
Current = new BindableDouble(5)
{
Precision = 0.1,
MinValue = 0,
MaxValue = 15
},
RelativeSizeAxes = Axes.X,
Width = 0.4f
};
});
}
[Test]