Display placeholder if no statistics available

This commit is contained in:
smoogipoo
2020-06-18 22:21:30 +09:00
parent 20db5b33ab
commit ecdfcb1955
3 changed files with 63 additions and 21 deletions

View File

@ -3,6 +3,8 @@
using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Osu;
using osu.Game.Scoring;
using osu.Game.Screens.Ranking.Statistics;
@ -12,7 +14,7 @@ namespace osu.Game.Tests.Visual.Ranking
public class TestSceneStatisticsPanel : OsuTestScene
{
[Test]
public void TestScore()
public void TestScoreWithStatistics()
{
var score = new TestScoreInfo(new OsuRuleset().RulesetInfo)
{
@ -22,9 +24,20 @@ namespace osu.Game.Tests.Visual.Ranking
loadPanel(score);
}
[Test]
public void TestScoreWithoutStatistics()
{
loadPanel(new TestScoreInfo(new OsuRuleset().RulesetInfo));
}
private void loadPanel(ScoreInfo score) => AddStep("load panel", () =>
{
Child = new StatisticsPanel(score);
Child = new StatisticsPanel
{
RelativeSizeAxes = Axes.Both,
State = { Value = Visibility.Visible },
Score = { Value = score }
};
});
}
}