mirror of
https://github.com/ppy/osu.git
synced 2024-12-17 05:22:54 +08:00
Use ChildrenOfType<>
to get ScoreTable to test
This commit is contained in:
parent
dcd3e5194e
commit
750e0b29ca
@ -103,16 +103,21 @@ namespace osu.Game.Tests.Visual.Online
|
||||
});
|
||||
|
||||
AddUntilStep("wait for scores displayed", () => scoresContainer.ChildrenOfType<ScoreTableRowBackground>().Any());
|
||||
AddAssert("only one column for slider end", () => scoresContainer.ScoreTable.Columns.Count(c => c.Header.Equals("slider end")) == 1);
|
||||
AddAssert("only one column for slider end", () =>
|
||||
{
|
||||
ScoreTable scoreTable = scoresContainer.ChildrenOfType<ScoreTable>().First();
|
||||
return scoreTable.Columns.Count(c => c.Header.Equals("slider end")) == 1;
|
||||
});
|
||||
|
||||
AddAssert("all rows show non-zero slider ends", () =>
|
||||
{
|
||||
int sliderEndColumnIndex = Array.FindIndex(scoresContainer.ScoreTable.Columns, c => c != null && c.Header.Equals("slider end"));
|
||||
ScoreTable scoreTable = scoresContainer.ChildrenOfType<ScoreTable>().First();
|
||||
int sliderEndColumnIndex = Array.FindIndex(scoreTable.Columns, c => c != null && c.Header.Equals("slider end"));
|
||||
bool sliderEndFilledInEachRow = true;
|
||||
|
||||
for (int i = 0; i < scoresContainer.ScoreTable.Content?.GetLength(0); i++)
|
||||
for (int i = 0; i < scoreTable.Content?.GetLength(0); i++)
|
||||
{
|
||||
switch (scoresContainer.ScoreTable.Content[i, sliderEndColumnIndex])
|
||||
switch (scoreTable.Content[i, sliderEndColumnIndex])
|
||||
{
|
||||
case OsuSpriteText text:
|
||||
if (text.Text.Equals(0.0d.ToLocalisableString(@"N0")))
|
||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
private readonly IBindable<APIUser> user = new Bindable<APIUser>();
|
||||
|
||||
private readonly Box background;
|
||||
public readonly ScoreTable ScoreTable;
|
||||
private readonly ScoreTable scoreTable;
|
||||
private readonly FillFlowContainer topScoresContainer;
|
||||
private readonly LoadingLayer loading;
|
||||
private readonly LeaderboardModSelector modSelector;
|
||||
@ -59,8 +59,8 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
loadCancellationSource = new CancellationTokenSource();
|
||||
|
||||
topScoresContainer.Clear();
|
||||
ScoreTable.ClearScores();
|
||||
ScoreTable.Hide();
|
||||
scoreTable.ClearScores();
|
||||
scoreTable.Hide();
|
||||
|
||||
loading.Hide();
|
||||
loading.FinishTransforms();
|
||||
@ -85,8 +85,8 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
var scores = value.Scores.Select(s => s.ToScoreInfo(rulesets, beatmapInfo)).OrderByTotalScore().ToArray();
|
||||
var topScore = scores.First();
|
||||
|
||||
ScoreTable.DisplayScores(scores, apiBeatmap.Status.GrantsPerformancePoints());
|
||||
ScoreTable.Show();
|
||||
scoreTable.DisplayScores(scores, apiBeatmap.Status.GrantsPerformancePoints());
|
||||
scoreTable.Show();
|
||||
|
||||
var userScore = value.UserScore;
|
||||
var userScoreInfo = userScore?.Score.ToScoreInfo(rulesets, beatmapInfo);
|
||||
@ -175,7 +175,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 5),
|
||||
},
|
||||
ScoreTable = new ScoreTable
|
||||
scoreTable = new ScoreTable
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
|
Loading…
Reference in New Issue
Block a user