1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 00:02:56 +08:00

Actualize tests

This commit is contained in:
Roman Kapustin 2021-03-11 21:02:40 +03:00
parent 47b80d2474
commit c6c616f244
4 changed files with 7 additions and 9 deletions

View File

@ -56,6 +56,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
beatmaps.Add(new BeatmapInfo beatmaps.Add(new BeatmapInfo
{ {
Ruleset = rulesets.GetRuleset(i % 4), Ruleset = rulesets.GetRuleset(i % 4),
RulesetID = i % 4,
OnlineBeatmapID = beatmapId, OnlineBeatmapID = beatmapId,
Length = length, Length = length,
BPM = bpm, BPM = bpm,

View File

@ -186,6 +186,7 @@ namespace osu.Game.Tests.Visual.SongSelect
Metadata = metadata, Metadata = metadata,
BaseDifficulty = new BeatmapDifficulty(), BaseDifficulty = new BeatmapDifficulty(),
Ruleset = ruleset, Ruleset = ruleset,
RulesetID = ruleset.ID.GetValueOrDefault(),
StarDifficulty = difficultyIndex + 1, StarDifficulty = difficultyIndex + 1,
Version = $"SR{difficultyIndex + 1}" Version = $"SR{difficultyIndex + 1}"
}).ToList() }).ToList()

View File

@ -911,9 +911,11 @@ namespace osu.Game.Tests.Visual.SongSelect
int length = RNG.Next(30000, 200000); int length = RNG.Next(30000, 200000);
double bpm = RNG.NextSingle(80, 200); double bpm = RNG.NextSingle(80, 200);
var ruleset = getRuleset();
beatmaps.Add(new BeatmapInfo beatmaps.Add(new BeatmapInfo
{ {
Ruleset = getRuleset(), Ruleset = ruleset,
RulesetID = ruleset.ID.GetValueOrDefault(),
OnlineBeatmapID = beatmapId, OnlineBeatmapID = beatmapId,
Version = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss}, bpm {bpm:0.#})", Version = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss}, bpm {bpm:0.#})",
Length = length, Length = length,

View File

@ -73,7 +73,7 @@ namespace osu.Game.Scoring
} }
set set
{ {
modsJson = null; modsJson = JsonConvert.SerializeObject(value.Select(m => new DeserializedMod { Acronym = m.Acronym }));
mods = value; mods = value;
} }
} }
@ -88,13 +88,7 @@ namespace osu.Game.Scoring
{ {
get get
{ {
if (modsJson != null)
return modsJson; return modsJson;
if (mods == null)
return null;
return modsJson = JsonConvert.SerializeObject(mods.Select(m => new DeserializedMod { Acronym = m.Acronym }));
} }
set set
{ {