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:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user