1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 03:22:55 +08:00

Add test of cyclic beatmap/beatmapset references

This commit is contained in:
Dean Herbert 2022-01-12 12:42:45 +09:00
parent 509301d94f
commit c92aff8d2b

View File

@ -36,7 +36,7 @@ namespace osu.Game.Tests.Database
public class BeatmapImporterTests : RealmTest
{
[Test]
public void TestDetach()
public void TestDetachBeatmapSet()
{
RunTestWithRealmAsync(async (realmFactory, storage) =>
{
@ -71,7 +71,11 @@ namespace osu.Game.Tests.Database
Assert.NotZero(detachedBeatmapSet.Files.Select(f => f.File).Count());
Assert.NotNull(detachedBeatmapSet.Beatmaps.Count);
Assert.NotZero(detachedBeatmapSet.Beatmaps.Select(f => f.Difficulty).Count());
Assert.NotNull(detachedBeatmapSet.Beatmaps.First().Path);
Assert.NotNull(detachedBeatmapSet.Metadata);
// Check cyclic reference to beatmap set
Assert.AreEqual(detachedBeatmapSet, detachedBeatmapSet.Beatmaps.First().BeatmapSet);
}
});
}