mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 21:37:59 +09:00
Update tests to match new behaviour
This commit is contained in:
parent
60b80c88b6
commit
1db2135d70
@ -57,8 +57,9 @@ namespace osu.Game.Tests.Database
|
|||||||
{
|
{
|
||||||
detachedBeatmapSet = live.Detach();
|
detachedBeatmapSet = live.Detach();
|
||||||
|
|
||||||
Assert.AreEqual(live.Files.Count, detachedBeatmapSet.Files.Count);
|
// files are omitted
|
||||||
Assert.AreEqual(live.Files.Select(f => f.File).Count(), detachedBeatmapSet.Files.Select(f => f.File).Count());
|
Assert.AreEqual(0, detachedBeatmapSet.Files.Count);
|
||||||
|
|
||||||
Assert.AreEqual(live.Beatmaps.Count, detachedBeatmapSet.Beatmaps.Count);
|
Assert.AreEqual(live.Beatmaps.Count, detachedBeatmapSet.Beatmaps.Count);
|
||||||
Assert.AreEqual(live.Beatmaps.Select(f => f.Difficulty).Count(), detachedBeatmapSet.Beatmaps.Select(f => f.Difficulty).Count());
|
Assert.AreEqual(live.Beatmaps.Select(f => f.Difficulty).Count(), detachedBeatmapSet.Beatmaps.Select(f => f.Difficulty).Count());
|
||||||
Assert.AreEqual(live.Metadata, detachedBeatmapSet.Metadata);
|
Assert.AreEqual(live.Metadata, detachedBeatmapSet.Metadata);
|
||||||
@ -67,11 +68,9 @@ namespace osu.Game.Tests.Database
|
|||||||
Debug.Assert(detachedBeatmapSet != null);
|
Debug.Assert(detachedBeatmapSet != null);
|
||||||
|
|
||||||
// Check detached instances can all be accessed without throwing.
|
// Check detached instances can all be accessed without throwing.
|
||||||
Assert.NotNull(detachedBeatmapSet.Files.Count);
|
Assert.AreEqual(0, detachedBeatmapSet.Files.Count);
|
||||||
Assert.NotZero(detachedBeatmapSet.Files.Select(f => f.File).Count());
|
|
||||||
Assert.NotNull(detachedBeatmapSet.Beatmaps.Count);
|
Assert.NotNull(detachedBeatmapSet.Beatmaps.Count);
|
||||||
Assert.NotZero(detachedBeatmapSet.Beatmaps.Select(f => f.Difficulty).Count());
|
Assert.NotZero(detachedBeatmapSet.Beatmaps.Select(f => f.Difficulty).Count());
|
||||||
Assert.NotNull(detachedBeatmapSet.Beatmaps.First().Path);
|
|
||||||
Assert.NotNull(detachedBeatmapSet.Metadata);
|
Assert.NotNull(detachedBeatmapSet.Metadata);
|
||||||
|
|
||||||
// Check cyclic reference to beatmap set
|
// Check cyclic reference to beatmap set
|
||||||
@ -96,9 +95,12 @@ namespace osu.Game.Tests.Database
|
|||||||
Assert.NotNull(beatmapSet);
|
Assert.NotNull(beatmapSet);
|
||||||
Debug.Assert(beatmapSet != null);
|
Debug.Assert(beatmapSet != null);
|
||||||
|
|
||||||
BeatmapSetInfo? detachedBeatmapSet = null;
|
// Detach at the BeatmapInfo point, similar to what GetWorkingBeatmap does.
|
||||||
|
BeatmapInfo? detachedBeatmap = null;
|
||||||
|
|
||||||
beatmapSet.PerformRead(s => detachedBeatmapSet = s.Detach());
|
beatmapSet.PerformRead(s => detachedBeatmap = s.Beatmaps.First().Detach());
|
||||||
|
|
||||||
|
BeatmapSetInfo? detachedBeatmapSet = detachedBeatmap?.BeatmapSet;
|
||||||
|
|
||||||
Debug.Assert(detachedBeatmapSet != null);
|
Debug.Assert(detachedBeatmapSet != null);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user