mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 05:57:29 +08:00
49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
// 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.
|
|
|
|
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;
|
|
|
|
namespace osu.Game.Tests.Visual.Ranking
|
|
{
|
|
public class TestSceneStatisticsPanel : OsuTestScene
|
|
{
|
|
[Test]
|
|
public void TestScoreWithStatistics()
|
|
{
|
|
var score = new TestScoreInfo(new OsuRuleset().RulesetInfo)
|
|
{
|
|
HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents()
|
|
};
|
|
|
|
loadPanel(score);
|
|
}
|
|
|
|
[Test]
|
|
public void TestScoreWithoutStatistics()
|
|
{
|
|
loadPanel(new TestScoreInfo(new OsuRuleset().RulesetInfo));
|
|
}
|
|
|
|
[Test]
|
|
public void TestNullScore()
|
|
{
|
|
loadPanel(null);
|
|
}
|
|
|
|
private void loadPanel(ScoreInfo score) => AddStep("load panel", () =>
|
|
{
|
|
Child = new StatisticsPanel
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
State = { Value = Visibility.Visible },
|
|
Score = { Value = score }
|
|
};
|
|
});
|
|
}
|
|
}
|