1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

test(osu.Game): add slider steps to change the size in timing distribution graph tests

This commit is contained in:
Acid Chicken (硫酸鶏) 2022-09-12 04:43:15 +09:00
parent aa823161f1
commit bb3d5bc9f4
No known key found for this signature in database
GPG Key ID: 3E87B98A3F6BAB99

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
@ -19,14 +20,24 @@ namespace osu.Game.Tests.Visual.Ranking
public class TestSceneHitEventTimingDistributionGraph : OsuTestScene
{
private HitEventTimingDistributionGraph graph = null!;
private readonly BindableFloat width = new BindableFloat(600);
private readonly BindableFloat height = new BindableFloat(130);
private static readonly HitObject placeholder_object = new HitCircle();
public TestSceneHitEventTimingDistributionGraph()
{
width.BindValueChanged(e => graph.Width = e.NewValue);
height.BindValueChanged(e => graph.Height = e.NewValue);
}
[Test]
public void TestManyDistributedEvents()
{
createTest(CreateDistributedHitEvents());
AddStep("add adjustment", () => graph.UpdateOffset(10));
AddSliderStep("width", 0.0f, 1000.0f, width.Value, width.Set);
AddSliderStep("height", 0.0f, 1000.0f, height.Value, height.Set);
}
[Test]
@ -137,7 +148,7 @@ namespace osu.Game.Tests.Visual.Ranking
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(600, 130)
Size = new Vector2(width.Value, height.Value)
}
};
});