mirror of
https://github.com/ppy/osu.git
synced 2026-05-19 04:32:11 +08:00
Adjust tests to new beatmap set model usage in carousel
This commit is contained in:
@@ -181,7 +181,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
AddUntilStep("beatmap in song select", () =>
|
||||
{
|
||||
var songSelect = (SoloSongSelect)Game.ScreenStack.CurrentScreen;
|
||||
return songSelect.ChildrenOfType<BeatmapCarousel>().Single().GetCarouselItems()!.Any(i => i.Model is BeatmapSetInfo bsi && bsi.MatchesOnlineID(getImport()));
|
||||
return songSelect.ChildrenOfType<BeatmapCarousel>().Single().GetCarouselItems()!.Any(i => i.Model is BeatmapSetUnderGrouping bsug && bsug.BeatmapSet.MatchesOnlineID(getImport()));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
];
|
||||
|
||||
var results = await runGrouping(GroupMode.None, beatmapSets);
|
||||
Assert.That(results.Select(r => r.Model).OfType<BeatmapSetInfo>(), Is.EquivalentTo(beatmapSets));
|
||||
Assert.That(results.Select(r => r.Model).OfType<BeatmapSetUnderGrouping>().Select(setUnderGrouping => setUnderGrouping.BeatmapSet), Is.EquivalentTo(beatmapSets));
|
||||
Assert.That(results.Select(r => r.Model).OfType<BeatmapInfo>(), Is.EquivalentTo(allBeatmaps));
|
||||
assertTotal(results, beatmapSets.Count + allBeatmaps.Length);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
|
||||
// Using groupingFilter.SetItems.Count alone doesn't work.
|
||||
// When sorting by difficulty, there can be more than one set panel for the same set displayed.
|
||||
return groupingFilter.SetItems.Sum(s => s.Value.Count(i => i.Model is BeatmapSetInfo));
|
||||
return groupingFilter.SetItems.Sum(s => s.Value.Count(i => i.Model is BeatmapSetUnderGrouping));
|
||||
}, () => Is.EqualTo(expected));
|
||||
}
|
||||
|
||||
|
||||
@@ -396,7 +396,9 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
ApplyToFilterAndWaitForFilter("filter first away", c => c.UserStarDifficulty.Min = 3);
|
||||
|
||||
SelectNextPanel();
|
||||
AddAssert("keyboard selected is first set", () => GetKeyboardSelectedPanel()?.Item?.Model, () => Is.EqualTo(BeatmapSets.First()));
|
||||
AddAssert("keyboard selected is first set",
|
||||
() => (GetKeyboardSelectedPanel()?.Item?.Model as BeatmapSetUnderGrouping)?.BeatmapSet,
|
||||
() => Is.EqualTo(BeatmapSets.First()));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -413,7 +415,9 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
ApplyToFilterAndWaitForFilter("filter first away", c => c.UserStarDifficulty.Min = 3);
|
||||
|
||||
SelectPrevPanel();
|
||||
AddAssert("keyboard selected is last set", () => GetKeyboardSelectedPanel()?.Item?.Model, () => Is.EqualTo(BeatmapSets.Last()));
|
||||
AddAssert("keyboard selected is last set",
|
||||
() => (GetKeyboardSelectedPanel()?.Item?.Model as BeatmapSetUnderGrouping)?.BeatmapSet,
|
||||
() => Is.EqualTo(BeatmapSets.Last()));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -428,7 +432,9 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
ApplyToFilterAndWaitForFilter("filter last set away", c => c.SearchText = BeatmapSets.First().Metadata.Title);
|
||||
|
||||
SelectPrevPanel();
|
||||
AddAssert("keyboard selected is first set", () => GetKeyboardSelectedPanel()?.Item?.Model, () => Is.EqualTo(BeatmapSets.First()));
|
||||
AddAssert("keyboard selected is first set",
|
||||
() => (GetKeyboardSelectedPanel()?.Item?.Model as BeatmapSetUnderGrouping)?.BeatmapSet,
|
||||
() => Is.EqualTo(BeatmapSets.First()));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -444,7 +450,9 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
|
||||
// Single result is automatically selected for us, so we iterate once backwards to the set header.
|
||||
SelectPrevPanel();
|
||||
AddAssert("keyboard selected is second set", () => GetKeyboardSelectedPanel()?.Item?.Model, () => Is.EqualTo(BeatmapSets.Last()));
|
||||
AddAssert("keyboard selected is second set",
|
||||
() => (GetKeyboardSelectedPanel()?.Item?.Model as BeatmapSetUnderGrouping)?.BeatmapSet,
|
||||
() => Is.EqualTo(BeatmapSets.Last()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,21 +75,21 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
{
|
||||
new PanelBeatmapSet
|
||||
{
|
||||
Item = new CarouselItem(beatmapSet)
|
||||
Item = new CarouselItem(new BeatmapSetUnderGrouping(null, beatmapSet))
|
||||
},
|
||||
new PanelBeatmapSet
|
||||
{
|
||||
Item = new CarouselItem(beatmapSet),
|
||||
Item = new CarouselItem(new BeatmapSetUnderGrouping(null, beatmapSet)),
|
||||
KeyboardSelected = { Value = true }
|
||||
},
|
||||
new PanelBeatmapSet
|
||||
{
|
||||
Item = new CarouselItem(beatmapSet),
|
||||
Item = new CarouselItem(new BeatmapSetUnderGrouping(null, beatmapSet)),
|
||||
Expanded = { Value = true }
|
||||
},
|
||||
new PanelBeatmapSet
|
||||
{
|
||||
Item = new CarouselItem(beatmapSet),
|
||||
Item = new CarouselItem(new BeatmapSetUnderGrouping(null, beatmapSet)),
|
||||
KeyboardSelected = { Value = true },
|
||||
Expanded = { Value = true }
|
||||
},
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace osu.Game.Tests.Visual.SongSelectV2
|
||||
AddAssert("no-collection group present", () =>
|
||||
{
|
||||
var group = grouping.GroupItems.Single(g => g.Key.Title == "Not in collection");
|
||||
return group.Value.Select(i => i.Model).OfType<BeatmapSetInfo>().Single().Equals(beatmapSet);
|
||||
return group.Value.Select(i => i.Model).OfType<BeatmapSetUnderGrouping>().Single().BeatmapSet.Equals(beatmapSet);
|
||||
});
|
||||
|
||||
AddStep("add beatmap to collection", () =>
|
||||
|
||||
Reference in New Issue
Block a user