Add ability to make test APIBeatmaps from test scenes

Allow tests to create a sample `APIBeatmapSet`

One step towards removing calls to `ToBeatmap` / `ToBeatmapSet`.
This commit is contained in:
Dean Herbert
2021-10-25 13:47:12 +09:00
parent 00d0221fd5
commit 19312435d0
3 changed files with 60 additions and 23 deletions

View File

@ -119,7 +119,7 @@ namespace osu.Game.Online.API.Requests.Responses
public string Tags { get; set; } = string.Empty;
[JsonProperty(@"beatmaps")]
private IEnumerable<APIBeatmap> beatmaps { get; set; } = Array.Empty<APIBeatmap>();
public IEnumerable<APIBeatmap> Beatmaps { get; set; } = Array.Empty<APIBeatmap>();
public virtual BeatmapSetInfo ToBeatmapSet(RulesetStore rulesets)
{
@ -132,7 +132,7 @@ namespace osu.Game.Online.API.Requests.Responses
OnlineInfo = this
};
beatmapSet.Beatmaps = beatmaps.Select(b =>
beatmapSet.Beatmaps = Beatmaps.Select(b =>
{
var beatmap = b.ToBeatmapInfo(rulesets);
beatmap.BeatmapSet = beatmapSet;
@ -157,7 +157,7 @@ namespace osu.Game.Online.API.Requests.Responses
#region Implementation of IBeatmapSetInfo
IEnumerable<IBeatmapInfo> IBeatmapSetInfo.Beatmaps => beatmaps;
IEnumerable<IBeatmapInfo> IBeatmapSetInfo.Beatmaps => Beatmaps;
IBeatmapMetadataInfo IBeatmapSetInfo.Metadata => metadata;