mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 12:53:11 +08:00
Fix TestSelectingFilteredRuleset
failing under visual tests due to using local database
This commit is contained in:
parent
cd806711f8
commit
41aa4b8cca
@ -601,7 +601,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
BeatmapSetInfo testMixed = null;
|
||||
|
||||
createCarousel();
|
||||
createCarousel(new List<BeatmapSetInfo>());
|
||||
|
||||
AddStep("add mixed ruleset beatmapset", () =>
|
||||
{
|
||||
@ -765,22 +765,22 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
createCarousel(c =>
|
||||
if (beatmapSets == null)
|
||||
{
|
||||
beatmapSets = new List<BeatmapSetInfo>();
|
||||
|
||||
for (int i = 1; i <= (count ?? set_count); i++)
|
||||
{
|
||||
beatmapSets.Add(randomDifficulties
|
||||
? TestResources.CreateTestBeatmapSetInfo()
|
||||
: TestResources.CreateTestBeatmapSetInfo(3));
|
||||
}
|
||||
}
|
||||
|
||||
createCarousel(beatmapSets, c =>
|
||||
{
|
||||
carouselAdjust?.Invoke(c);
|
||||
|
||||
if (beatmapSets == null)
|
||||
{
|
||||
beatmapSets = new List<BeatmapSetInfo>();
|
||||
|
||||
for (int i = 1; i <= (count ?? set_count); i++)
|
||||
{
|
||||
beatmapSets.Add(randomDifficulties
|
||||
? TestResources.CreateTestBeatmapSetInfo()
|
||||
: TestResources.CreateTestBeatmapSetInfo(3));
|
||||
}
|
||||
}
|
||||
|
||||
carousel.Filter(initialCriteria?.Invoke() ?? new FilterCriteria());
|
||||
carousel.BeatmapSetsChanged = () => changed = true;
|
||||
carousel.BeatmapSets = beatmapSets;
|
||||
@ -789,7 +789,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
AddUntilStep("Wait for load", () => changed);
|
||||
}
|
||||
|
||||
private void createCarousel(Action<BeatmapCarousel> carouselAdjust = null, Container target = null)
|
||||
private void createCarousel(List<BeatmapSetInfo> beatmapSets, Action<BeatmapCarousel> carouselAdjust = null, Container target = null)
|
||||
{
|
||||
AddStep("Create carousel", () =>
|
||||
{
|
||||
@ -803,6 +803,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
carouselAdjust?.Invoke(carousel);
|
||||
|
||||
carousel.BeatmapSets = beatmapSets;
|
||||
|
||||
(target ?? this).Child = carousel;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user