mirror of
https://github.com/ppy/osu.git
synced 2025-03-16 00:37:19 +08:00
Update sets of BeatmapSet.Metadata
to instead create a Beatmap
This commit is contained in:
parent
e6f6558ddf
commit
37673f4cf8
@ -5,6 +5,7 @@ using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Models;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using osu.Game.Tests.Visual;
|
||||
@ -20,15 +21,21 @@ namespace osu.Game.Tests.Online
|
||||
private static readonly BeatmapSetInfo test_db_model = new BeatmapSetInfo
|
||||
{
|
||||
OnlineID = 1,
|
||||
Beatmaps =
|
||||
{
|
||||
new BeatmapInfo
|
||||
{
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
Artist = "test author",
|
||||
Title = "test title",
|
||||
Author = new APIUser
|
||||
Author = new RealmUser
|
||||
{
|
||||
Username = "mapper"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private static readonly APIBeatmapSet test_online_model = new APIBeatmapSet
|
||||
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Beatmaps;
|
||||
@ -409,10 +410,10 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
var set = TestResources.CreateTestBeatmapSetInfo();
|
||||
|
||||
if (i == 4)
|
||||
set.Metadata.Artist = zzz_string;
|
||||
set.Beatmaps.ForEach(b => b.Metadata.Artist = zzz_string);
|
||||
|
||||
if (i == 16)
|
||||
set.Metadata.AuthorString = zzz_string;
|
||||
set.Beatmaps.ForEach(b => b.Metadata.AuthorString = zzz_string);
|
||||
|
||||
sets.Add(set);
|
||||
}
|
||||
@ -432,13 +433,19 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
// index + 1 because we are using OnlineID which should never be zero.
|
||||
var set = TestResources.CreateTestBeatmapSetInfo();
|
||||
set.Metadata.Artist = "same artist";
|
||||
set.Metadata.Title = "same title";
|
||||
|
||||
// only need to set the first as they are a shared reference.
|
||||
var beatmap = set.Beatmaps.First();
|
||||
|
||||
beatmap.Metadata.Artist = "same artist";
|
||||
beatmap.Metadata.Title = "same title";
|
||||
|
||||
sets.Add(set);
|
||||
}
|
||||
|
||||
int idOffset = sets.First().OnlineID ?? 0;
|
||||
int idOffset = sets.First().OnlineID;
|
||||
|
||||
loadBeatmaps(sets);
|
||||
|
||||
@ -674,7 +681,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
AddStep("Restore different ruleset filter", () =>
|
||||
{
|
||||
carousel.Filter(new FilterCriteria { Ruleset = rulesets.GetRuleset(1) }, false);
|
||||
eagerSelectedIDs.Add(carousel.SelectedBeatmapSet.OnlineID ?? -1);
|
||||
eagerSelectedIDs.Add(carousel.SelectedBeatmapSet.ID);
|
||||
});
|
||||
|
||||
AddAssert("selection changed", () => !carousel.SelectedBeatmapInfo.Equals(manySets.First().Beatmaps.First()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user