add test for overall difficulty filter query

This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-06-26 21:02:57 +07:00
parent 8e1bcc4d6b
commit 4df4afe533
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2
1 changed files with 14 additions and 0 deletions

View File

@ -90,6 +90,20 @@ public void TestApplyDrainRateQueriesByHpKeyword()
Assert.Less(filterCriteria.DrainRate.Min, 6.1f); Assert.Less(filterCriteria.DrainRate.Min, 6.1f);
} }
[Test]
public void TestApplyOverallDifficultyQueries()
{
const string query = "od>4 easy od<8";
var filterCriteria = new FilterCriteria();
FilterQueryParser.ApplyQueries(filterCriteria, query);
Assert.AreEqual("easy", filterCriteria.SearchText.Trim());
Assert.AreEqual(1, filterCriteria.SearchTerms.Length);
Assert.Greater(filterCriteria.OverallDifficulty.Min, 4.0);
Assert.Less(filterCriteria.OverallDifficulty.Min, 4.1);
Assert.Greater(filterCriteria.OverallDifficulty.Max, 7.9);
Assert.Less(filterCriteria.OverallDifficulty.Max, 8.0);
}
[Test] [Test]
public void TestApplyBPMQueries() public void TestApplyBPMQueries()
{ {