Add failing test of date submitted search failing

This commit is contained in:
Dean Herbert 2022-09-01 19:59:20 +09:00
parent db9970b72a
commit 148e487c02

View File

@ -494,6 +494,43 @@ namespace osu.Game.Tests.Visual.SongSelect
AddAssert("Something is selected", () => carousel.SelectedBeatmapInfo != null);
}
[Test]
public void TestSortingDateSubmitted()
{
var sets = new List<BeatmapSetInfo>();
const string zzz_string = "zzzzz";
AddStep("Populuate beatmap sets", () =>
{
sets.Clear();
for (int i = 0; i < 20; i++)
{
var set = TestResources.CreateTestBeatmapSetInfo(5);
if (i >= 2 && i < 10)
set.DateSubmitted = DateTimeOffset.Now.AddMinutes(i);
if (i < 5)
set.Beatmaps.ForEach(b => b.Metadata.Artist = zzz_string);
sets.Add(set);
}
});
loadBeatmaps(sets);
AddStep("Sort by date submitted", () => carousel.Filter(new FilterCriteria { Sort = SortMode.DateSubmitted }, false));
checkVisibleItemCount(diff: false, count: 8);
checkVisibleItemCount(diff: true, count: 5);
AddStep("Sort by date submitted and string", () => carousel.Filter(new FilterCriteria
{
Sort = SortMode.DateSubmitted,
SearchText = zzz_string
}, false));
checkVisibleItemCount(diff: false, count: 3);
checkVisibleItemCount(diff: true, count: 5);
}
[Test]
public void TestSorting()
{