mirror of
https://github.com/ppy/osu.git
synced 2026-06-06 13:54:26 +08:00
Added FilterMatchTest for InvertRange
This commit is contained in:
committed by
Dean Herbert
Unverified
parent
cc970ffd80
commit
02f835dbc3
@@ -146,6 +146,30 @@ namespace osu.Game.Tests.NonVisual.Filtering
|
||||
Assert.AreEqual(!inclusive, carouselItem.Filtered.Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[TestCase(true)]
|
||||
[TestCase(false)]
|
||||
public void TestCriteriaMatchingInvertedRange(bool inverted)
|
||||
{
|
||||
var exampleBeatmapInfo = getExampleBeatmap();
|
||||
var criteria = new FilterCriteria
|
||||
{
|
||||
Ruleset = new RulesetInfo { OnlineID = 6 },
|
||||
AllowConvertedBeatmaps = true,
|
||||
StarDifficulty = new FilterCriteria.OptionalRange<double>
|
||||
{
|
||||
Max = 4.0d,
|
||||
Min = 4.0d,
|
||||
IsLowerInclusive = true,
|
||||
IsUpperInclusive = true,
|
||||
InvertRange = inverted
|
||||
}
|
||||
};
|
||||
var carouselItem = new CarouselBeatmap(exampleBeatmapInfo);
|
||||
carouselItem.Filter(criteria);
|
||||
Assert.AreEqual(inverted, carouselItem.Filtered.Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[TestCase("artist", false)]
|
||||
[TestCase("artist title author", false)]
|
||||
|
||||
Reference in New Issue
Block a user