update tests to new profile score format

This commit is contained in:
tsunyoku
2022-07-17 14:08:44 +01:00
parent ef4237c4ac
commit 71a4b8843f

View File

@ -21,20 +21,12 @@ namespace osu.Game.Tests.Visual.Online
{ {
public TestSceneUserProfileScores() public TestSceneUserProfileScores()
{ {
var firstScore = new APIScore var firstScore = new SoloScoreInfo
{ {
PP = 1047.21, PP = 1047.21,
Rank = ScoreRank.SH, Rank = ScoreRank.SH,
Beatmap = new APIBeatmap BeatmapID = 2058788,
{ EndedAt = DateTimeOffset.Now,
BeatmapSet = new APIBeatmapSet
{
Title = "JUSTadICE (TV Size)",
Artist = "Oomori Seiko",
},
DifficultyName = "Extreme"
},
Date = DateTimeOffset.Now,
Mods = new[] Mods = new[]
{ {
new APIMod { Acronym = new OsuModHidden().Acronym }, new APIMod { Acronym = new OsuModHidden().Acronym },
@ -43,21 +35,22 @@ namespace osu.Game.Tests.Visual.Online
}, },
Accuracy = 0.9813 Accuracy = 0.9813
}; };
var firstBeatmap = new APIBeatmap
{
BeatmapSet = new APIBeatmapSet()
{
Title = "JUSTadICE (TV Size)",
Artist = "Oomori Seiko",
},
DifficultyName = "Extreme"
};
var secondScore = new APIScore var secondScore = new SoloScoreInfo
{ {
PP = 134.32, PP = 134.32,
Rank = ScoreRank.A, Rank = ScoreRank.A,
Beatmap = new APIBeatmap BeatmapID = 767046,
{ EndedAt = DateTimeOffset.Now,
BeatmapSet = new APIBeatmapSet
{
Title = "Triumph & Regret",
Artist = "typeMARS",
},
DifficultyName = "[4K] Regret"
},
Date = DateTimeOffset.Now,
Mods = new[] Mods = new[]
{ {
new APIMod { Acronym = new OsuModHardRock().Acronym }, new APIMod { Acronym = new OsuModHardRock().Acronym },
@ -65,38 +58,49 @@ namespace osu.Game.Tests.Visual.Online
}, },
Accuracy = 0.998546 Accuracy = 0.998546
}; };
var secondBeatmap = new APIBeatmap
{
BeatmapSet = new APIBeatmapSet()
{
Title = "Triumph & Regret",
Artist = "typeMARS",
},
DifficultyName = "[4K] Regret"
};
var thirdScore = new APIScore var thirdScore = new SoloScoreInfo
{ {
PP = 96.83, PP = 96.83,
Rank = ScoreRank.S, Rank = ScoreRank.S,
Beatmap = new APIBeatmap BeatmapID = 2134713,
EndedAt = DateTimeOffset.Now,
Accuracy = 0.9726
};
var thirdBeatmap = new APIBeatmap
{ {
BeatmapSet = new APIBeatmapSet BeatmapSet = new APIBeatmapSet()
{ {
Title = "Idolize", Title = "Idolize",
Artist = "Creo", Artist = "Creo",
}, },
DifficultyName = "Insane" DifficultyName = "Insane"
},
Date = DateTimeOffset.Now,
Accuracy = 0.9726
}; };
var noPPScore = new APIScore var noPPScore = new SoloScoreInfo
{ {
Rank = ScoreRank.B, Rank = ScoreRank.B,
Beatmap = new APIBeatmap BeatmapID = 992512,
EndedAt = DateTimeOffset.Now,
Accuracy = 0.55879
};
var noPPBeatmap = new APIBeatmap
{ {
BeatmapSet = new APIBeatmapSet BeatmapSet = new APIBeatmapSet()
{ {
Title = "C18H27NO3(extend)", Title = "Galaxy Collapse",
Artist = "Team Grimoire", Artist = "Kurokotei",
}, },
DifficultyName = "[4K] Cataclysmic Hypernova" DifficultyName = "[4K] Cataclysmic Hypernova"
},
Date = DateTimeOffset.Now,
Accuracy = 0.55879
}; };
Add(new FillFlowContainer Add(new FillFlowContainer
@ -109,12 +113,12 @@ namespace osu.Game.Tests.Visual.Online
Spacing = new Vector2(0, 10), Spacing = new Vector2(0, 10),
Children = new[] Children = new[]
{ {
new ColourProvidedContainer(OverlayColourScheme.Green, new DrawableProfileScore(firstScore)), new ColourProvidedContainer(OverlayColourScheme.Green, new DrawableProfileScore(firstScore, firstBeatmap)),
new ColourProvidedContainer(OverlayColourScheme.Green, new DrawableProfileScore(secondScore)), new ColourProvidedContainer(OverlayColourScheme.Green, new DrawableProfileScore(secondScore, secondBeatmap)),
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileScore(noPPScore)), new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileScore(noPPScore, noPPBeatmap)),
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(firstScore, 0.97)), new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(firstScore, firstBeatmap, 0.97)),
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(secondScore, 0.85)), new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(secondScore, secondBeatmap, 0.85)),
new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(thirdScore, 0.66)), new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(thirdScore, thirdBeatmap, 0.66)),
} }
}); });
} }