1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-01 23:40:39 +08:00

Update test helper methods to use non-reference comparison

This isn't strictly required, but there should be no gaurantee or
requirement that the references are equal in these checks, so it's best
change them as such.
This commit is contained in:
Dean Herbert
2025-05-27 18:16:45 +09:00
Unverified
parent 0a07aef594
commit 8ccd6a4e4a
@@ -220,7 +220,8 @@ namespace osu.Game.Tests.Visual.SongSelectV2
// offset by one because the group itself is included in the items list.
CarouselItem item = groupingFilter.GroupItems[g].ElementAt(panel + 1);
return ReferenceEquals(Carousel.CurrentSelection, item.Model);
return (Carousel.CurrentSelection as BeatmapInfo)?
.Equals(item.Model as BeatmapInfo) == true;
});
}
@@ -229,7 +230,10 @@ namespace osu.Game.Tests.Visual.SongSelectV2
AddUntilStep($"selected is set{set}{(diff.HasValue ? $" diff{diff.Value}" : "")}", () =>
{
if (diff != null)
return ReferenceEquals(Carousel.CurrentSelection, BeatmapSets[set].Beatmaps[diff.Value]);
{
return (Carousel.CurrentSelection as BeatmapInfo)?
.Equals(BeatmapSets[set].Beatmaps[diff.Value]) == true;
}
return BeatmapSets[set].Beatmaps.Contains(Carousel.CurrentSelection);
});