2020-06-15 21:45:18 +08:00
|
|
|
// 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;
|
2020-06-18 21:21:30 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2020-06-15 21:45:18 +08:00
|
|
|
using osu.Game.Rulesets.Osu;
|
|
|
|
using osu.Game.Scoring;
|
|
|
|
using osu.Game.Screens.Ranking.Statistics;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Ranking
|
|
|
|
{
|
2020-06-16 15:08:41 +08:00
|
|
|
public class TestSceneStatisticsPanel : OsuTestScene
|
2020-06-15 21:45:18 +08:00
|
|
|
{
|
|
|
|
[Test]
|
2020-06-18 21:21:30 +08:00
|
|
|
public void TestScoreWithStatistics()
|
2020-06-15 21:45:18 +08:00
|
|
|
{
|
2020-06-16 16:49:37 +08:00
|
|
|
var score = new TestScoreInfo(new OsuRuleset().RulesetInfo)
|
|
|
|
{
|
2020-06-19 19:03:18 +08:00
|
|
|
HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents()
|
2020-06-16 16:49:37 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
loadPanel(score);
|
2020-06-15 21:45:18 +08:00
|
|
|
}
|
|
|
|
|
2020-06-18 21:21:30 +08:00
|
|
|
[Test]
|
|
|
|
public void TestScoreWithoutStatistics()
|
|
|
|
{
|
|
|
|
loadPanel(new TestScoreInfo(new OsuRuleset().RulesetInfo));
|
|
|
|
}
|
|
|
|
|
2020-06-15 21:45:18 +08:00
|
|
|
private void loadPanel(ScoreInfo score) => AddStep("load panel", () =>
|
|
|
|
{
|
2020-06-18 21:21:30 +08:00
|
|
|
Child = new StatisticsPanel
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
State = { Value = Visibility.Visible },
|
|
|
|
Score = { Value = score }
|
|
|
|
};
|
2020-06-15 21:45:18 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|