1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 06:52:55 +08:00
osu-lazer/osu.Desktop.VisualTests/Tests/TestCaseResults.cs

67 lines
1.9 KiB
C#
Raw Normal View History

2017-04-18 21:35:21 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
2017-04-18 20:36:34 +08:00
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Ranking;
using osu.Game.Users;
namespace osu.Desktop.VisualTests.Tests
{
internal class TestCaseResults : TestCase
{
private BeatmapDatabase db;
public override string Description => @"Results after playing.";
[BackgroundDependencyLoader]
private void load(BeatmapDatabase db)
{
this.db = db;
}
private WorkingBeatmap beatmap;
protected override void LoadComplete()
{
base.LoadComplete();
if (beatmap == null)
{
var beatmapInfo = db.Query<BeatmapInfo>().FirstOrDefault(b => b.RulesetID == 0);
if (beatmapInfo != null)
beatmap = db.GetWorkingBeatmap(beatmapInfo);
}
Add(new Results(new Score
{
TotalScore = 2845370,
Accuracy = 0.98,
2017-04-18 20:35:41 +08:00
MaxCombo = 123,
Rank = ScoreRank.A,
2017-05-16 21:14:50 +08:00
Date = DateTimeOffset.Now,
Statistics = new Dictionary<string, dynamic>
{
{ "300", 50 },
{ "100", 20 },
{ "50", 50 },
{ "x", 1 }
},
User = new User
{
Username = "peppy",
}
})
{
2017-07-19 12:32:16 +08:00
InitialBeatmap = beatmap
});
}
}
}