1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 18:12:55 +08:00

Create TestSceneProgressiveStatistic.cs

This commit is contained in:
Thomas Mok 2024-09-12 17:05:41 +01:00 committed by GitHub
parent d98848c36b
commit 4e8d2e5d20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,66 @@
// 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.
#nullable disable
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Screens.Ranking.Statistics;
namespace osu.Game.Tests.Visual.Ranking
{
public partial class TestSceneProgressiveStatistic : OsuTestScene
{
private Container container;
[SetUp]
public void SetUp() => Schedule(() =>
{
Child = new Container
{
AutoSizeAxes = Axes.Y,
Width = 700,
Children = new Drawable[]
{
container = new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
}
}
};
});
[Test]
public void TestDisplayAccuracy()
{
AddStep("50%",
() => container.Add(new ProgressiveStatistic(0.5000f, 1)));
AddStep("90%",
() => container.Add(new ProgressiveStatistic(0.9000f, 1)));
AddStep("95%",
() => container.Add(new ProgressiveStatistic(0.9500f, 1)));
AddStep("99%",
() => container.Add(new ProgressiveStatistic(0.9900f, 1)));
AddStep("100%",
() => container.Add(new ProgressiveStatistic(1, 1)));
}
[Test]
public void TestDisplayCombo()
{
// testing with combo 1000, but can be used for pp
AddStep("500/1000",
() => container.Add(new ProgressiveStatistic(500, 1000)));
AddStep("750/1000",
() => container.Add(new ProgressiveStatistic(750, 1000)));
AddStep("950/1000",
() => container.Add(new ProgressiveStatistic(950, 1000)));
AddStep("999/1000",
() => container.Add(new ProgressiveStatistic(999, 1000)));
AddStep("1000/1000",
() => container.Add(new ProgressiveStatistic(1000, 1000)));
}
}
}