Skip to content

Commit

Permalink
Add failing test coverage for checking taiko HP too
Browse files Browse the repository at this point in the history
I was wrong, taiko uses HP (to calculate miss penalty).
  • Loading branch information
bdach committed Mar 26, 2024
1 parent 9b923b1 commit 8fb308c
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ public void TestOverallDifficultyTwoDecimals()
Assert.That(issues.Single().Template is CheckAbnormalDifficultySettings.IssueTemplateMoreThanOneDecimal);
}

[Test]
public void TestDrainRateTwoDecimals()
{
beatmap.Difficulty.DrainRate = 5.55f;

var context = getContext();
var issues = check.Run(context).ToList();

Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckAbnormalDifficultySettings.IssueTemplateMoreThanOneDecimal);
}

[Test]
public void TestOverallDifficultyUnder()
{
Expand All @@ -76,6 +88,30 @@ public void TestOverallDifficultyOver()
Assert.That(issues.Single().Template is CheckAbnormalDifficultySettings.IssueTemplateOutOfRange);
}

[Test]
public void TestDrainRateUnder()
{
beatmap.Difficulty.DrainRate = -10;

var context = getContext();
var issues = check.Run(context).ToList();

Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckAbnormalDifficultySettings.IssueTemplateOutOfRange);
}

[Test]
public void TestDrainRateOver()
{
beatmap.Difficulty.DrainRate = 20;

var context = getContext();
var issues = check.Run(context).ToList();

Assert.That(issues, Has.Count.EqualTo(1));
Assert.That(issues.Single().Template is CheckAbnormalDifficultySettings.IssueTemplateOutOfRange);
}

private BeatmapVerifierContext getContext()
{
return new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));
Expand Down

0 comments on commit 8fb308c

Please sign in to comment.