2021-08-11 13:43:16 +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 System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Bindables;
|
2021-11-04 17:02:44 +08:00
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
2021-08-11 13:43:16 +08:00
|
|
|
using osu.Game.Online.Rooms;
|
|
|
|
using osu.Game.Rulesets.Osu;
|
|
|
|
using osu.Game.Scoring;
|
|
|
|
using osu.Game.Screens.OnlinePlay.Multiplayer;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Multiplayer
|
|
|
|
{
|
|
|
|
public class TestSceneMultiplayerTeamResults : ScreenTestScene
|
|
|
|
{
|
2021-08-13 02:21:53 +08:00
|
|
|
[TestCase(7483253, 1048576)]
|
|
|
|
[TestCase(1048576, 7483253)]
|
2021-08-13 02:38:24 +08:00
|
|
|
[TestCase(1048576, 1048576)]
|
2021-08-14 03:30:26 +08:00
|
|
|
public void TestDisplayTeamResults(int team1Score, int team2Score)
|
2021-08-11 13:43:16 +08:00
|
|
|
{
|
2021-08-13 01:48:57 +08:00
|
|
|
MultiplayerResultsScreen screen = null;
|
|
|
|
|
2021-08-11 13:43:16 +08:00
|
|
|
AddStep("show results screen", () =>
|
|
|
|
{
|
|
|
|
var rulesetInfo = new OsuRuleset().RulesetInfo;
|
|
|
|
var beatmapInfo = CreateBeatmap(rulesetInfo).BeatmapInfo;
|
|
|
|
|
|
|
|
var score = new ScoreInfo
|
|
|
|
{
|
|
|
|
Rank = ScoreRank.B,
|
|
|
|
TotalScore = 987654,
|
|
|
|
Accuracy = 0.8,
|
|
|
|
MaxCombo = 500,
|
|
|
|
Combo = 250,
|
2021-10-04 16:35:53 +08:00
|
|
|
BeatmapInfo = beatmapInfo,
|
2021-11-04 17:02:44 +08:00
|
|
|
User = new APIUser { Username = "Test user" },
|
2021-08-11 13:43:16 +08:00
|
|
|
Date = DateTimeOffset.Now,
|
|
|
|
OnlineScoreID = 12345,
|
|
|
|
Ruleset = rulesetInfo,
|
|
|
|
};
|
|
|
|
|
|
|
|
PlaylistItem playlistItem = new PlaylistItem
|
|
|
|
{
|
|
|
|
BeatmapID = beatmapInfo.ID,
|
|
|
|
};
|
|
|
|
|
|
|
|
SortedDictionary<int, BindableInt> teamScores = new SortedDictionary<int, BindableInt>
|
|
|
|
{
|
2021-08-13 02:21:53 +08:00
|
|
|
{ 0, new BindableInt(team1Score) },
|
|
|
|
{ 1, new BindableInt(team2Score) }
|
2021-08-11 13:43:16 +08:00
|
|
|
};
|
|
|
|
|
2021-08-13 02:01:31 +08:00
|
|
|
Stack.Push(screen = new MultiplayerTeamResultsScreen(score, 1, playlistItem, teamScores));
|
2021-08-11 13:43:16 +08:00
|
|
|
});
|
2021-08-13 01:48:57 +08:00
|
|
|
|
|
|
|
AddUntilStep("wait for loaded", () => screen.IsLoaded);
|
2021-08-11 13:43:16 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|