1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 21:47:25 +08:00
osu-lazer/osu.Game.Tests/Visual/Gameplay/TestSceneResults.cs

68 lines
1.9 KiB
C#
Raw Normal View History

// 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.
2018-04-13 17:19:50 +08:00
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Scoring;
2018-11-28 15:12:57 +08:00
using osu.Game.Scoring;
using osu.Game.Screens.Play;
2018-04-13 17:19:50 +08:00
using osu.Game.Screens.Ranking;
using osu.Game.Screens.Ranking.Pages;
2018-04-13 17:19:50 +08:00
using osu.Game.Users;
2019-03-25 00:02:36 +08:00
namespace osu.Game.Tests.Visual.Gameplay
2018-04-13 17:19:50 +08:00
{
[TestFixture]
public class TestSceneResults : ScreenTestScene
2018-04-13 17:19:50 +08:00
{
private BeatmapManager beatmaps;
public override IReadOnlyList<Type> RequiredTypes => new[]
{
2018-11-28 17:33:01 +08:00
typeof(ScoreInfo),
2018-04-13 17:19:50 +08:00
typeof(Results),
typeof(ResultsPage),
typeof(ScoreResultsPage),
2018-12-27 14:30:02 +08:00
typeof(LocalLeaderboardPage)
2018-04-13 17:19:50 +08:00
};
[BackgroundDependencyLoader]
private void load(BeatmapManager beatmaps)
{
this.beatmaps = beatmaps;
}
protected override void LoadComplete()
{
base.LoadComplete();
var beatmapInfo = beatmaps.QueryBeatmap(b => b.RulesetID == 0);
if (beatmapInfo != null)
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmapInfo);
2018-04-13 17:19:50 +08:00
2019-02-15 16:01:06 +08:00
LoadScreen(new SoloResults(new ScoreInfo
2018-04-13 17:19:50 +08:00
{
TotalScore = 2845370,
Accuracy = 0.98,
MaxCombo = 123,
Rank = ScoreRank.A,
Date = DateTimeOffset.Now,
2018-12-05 18:44:01 +08:00
Statistics = new Dictionary<HitResult, int>
2018-04-13 17:19:50 +08:00
{
{ HitResult.Great, 50 },
{ HitResult.Good, 20 },
{ HitResult.Meh, 50 },
{ HitResult.Miss, 1 }
},
User = new User
{
Username = "peppy",
}
}));
2018-04-13 17:19:50 +08:00
}
}
}