1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-21 00:20:25 +08:00

Add testing

This commit is contained in:
Bartłomiej Dach
2025-06-24 11:37:23 +02:00
Unverified
parent c61ec0b86a
commit a78dc31d8b
2 changed files with 44 additions and 0 deletions
@@ -150,6 +150,24 @@ namespace osu.Game.Tests.Visual.Menus
});
});
// cross-reference: `TestSceneOverallRanking.TestRoundingTreatment()`.
AddStep("Test rounding treatment", () =>
{
var transientUpdateDisplay = this.ChildrenOfType<TransientUserStatisticsUpdateDisplay>().Single();
transientUpdateDisplay.LatestUpdate.Value = new ScoreBasedUserStatisticsUpdate(
new ScoreInfo(),
new UserStatistics
{
GlobalRank = 111_111,
PP = 5071.495M
},
new UserStatistics
{
GlobalRank = 111_111,
PP = 5072.99M
});
});
AddStep("No change 1", () =>
{
var transientUpdateDisplay = this.ChildrenOfType<TransientUserStatisticsUpdateDisplay>().Single();
@@ -46,6 +46,32 @@ namespace osu.Game.Tests.Visual.Ranking
});
}
// cross-reference: `TestSceneToolbarUserButton.TestTransientUserStatisticsDisplay()`, "Test rounding treatment" step.
[Test]
public void TestRoundingTreatment()
{
createDisplay();
displayUpdate(
new UserStatistics
{
GlobalRank = 12_345,
Accuracy = 98.99,
MaxCombo = 2_322,
RankedScore = 23_123_543_456,
TotalScore = 123_123_543_456,
PP = 5_071.495M
},
new UserStatistics
{
GlobalRank = 12_345,
Accuracy = 98.99,
MaxCombo = 2_322,
RankedScore = 23_123_543_456,
TotalScore = 123_123_543_456,
PP = 5_072.99M
});
}
[Test]
public void TestAllDecreased()
{