mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
TestCase fix
This commit is contained in:
@ -17,10 +17,11 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual
|
namespace osu.Game.Tests.Visual
|
||||||
{
|
{
|
||||||
[System.ComponentModel.Description("in BeatmapOverlay")]
|
[Description("in BeatmapOverlay")]
|
||||||
public class TestCaseBeatmapScoresContainer : OsuTestCase
|
public class TestCaseBeatmapScoresContainer : OsuTestCase
|
||||||
{
|
{
|
||||||
private readonly IEnumerable<APIScoreInfo> scores;
|
private readonly IEnumerable<APIScoreInfo> scores;
|
||||||
@ -160,11 +161,12 @@ namespace osu.Game.Tests.Visual
|
|||||||
Accuracy = 0.6543,
|
Accuracy = 0.6543,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
foreach(var s in scores)
|
foreach (var s in scores)
|
||||||
{
|
{
|
||||||
s.Statistics.Add(HitResult.Great, RNG.Next(2000));
|
s.Statistics.Add(HitResult.Great, RNG.Next(2000));
|
||||||
s.Statistics.Add(HitResult.Good, RNG.Next(2000));
|
s.Statistics.Add(HitResult.Good, RNG.Next(2000));
|
||||||
s.Statistics.Add(HitResult.Meh, RNG.Next(2000));
|
s.Statistics.Add(HitResult.Meh, RNG.Next(2000));
|
||||||
|
s.Statistics.Add(HitResult.Miss, RNG.Next(2000));
|
||||||
}
|
}
|
||||||
|
|
||||||
anotherScores = new[]
|
anotherScores = new[]
|
||||||
@ -277,6 +279,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
s.Statistics.Add(HitResult.Great, RNG.Next(2000));
|
s.Statistics.Add(HitResult.Great, RNG.Next(2000));
|
||||||
s.Statistics.Add(HitResult.Good, RNG.Next(2000));
|
s.Statistics.Add(HitResult.Good, RNG.Next(2000));
|
||||||
s.Statistics.Add(HitResult.Meh, RNG.Next(2000));
|
s.Statistics.Add(HitResult.Meh, RNG.Next(2000));
|
||||||
|
s.Statistics.Add(HitResult.Miss, RNG.Next(2000));
|
||||||
}
|
}
|
||||||
|
|
||||||
topScoreInfo = new APIScoreInfo
|
topScoreInfo = new APIScoreInfo
|
||||||
@ -304,6 +307,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
topScoreInfo.Statistics.Add(HitResult.Great, RNG.Next(2000));
|
topScoreInfo.Statistics.Add(HitResult.Great, RNG.Next(2000));
|
||||||
topScoreInfo.Statistics.Add(HitResult.Good, RNG.Next(2000));
|
topScoreInfo.Statistics.Add(HitResult.Good, RNG.Next(2000));
|
||||||
topScoreInfo.Statistics.Add(HitResult.Meh, RNG.Next(2000));
|
topScoreInfo.Statistics.Add(HitResult.Meh, RNG.Next(2000));
|
||||||
|
topScoreInfo.Statistics.Add(HitResult.Miss, RNG.Next(2000));
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
@ -73,6 +73,8 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
|
|
||||||
private void updateDisplay()
|
private void updateDisplay()
|
||||||
{
|
{
|
||||||
|
scoreTable.ClearScores();
|
||||||
|
|
||||||
loading = false;
|
loading = false;
|
||||||
|
|
||||||
var scoreCount = scores?.Count() ?? 0;
|
var scoreCount = scores?.Count() ?? 0;
|
||||||
@ -80,15 +82,12 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
if (scoreCount == 0)
|
if (scoreCount == 0)
|
||||||
{
|
{
|
||||||
topScore.Hide();
|
topScore.Hide();
|
||||||
scoreTable.ClearScores();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
topScore.Score = scores.FirstOrDefault();
|
topScore.Score = scores.FirstOrDefault();
|
||||||
topScore.Show();
|
topScore.Show();
|
||||||
|
|
||||||
scoreTable.ClearScores();
|
|
||||||
|
|
||||||
if (scoreCount < 2)
|
if (scoreCount < 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user