2023-06-23 00:37:25 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-02-14 15:22:14 +08:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Rulesets.Difficulty;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Difficulty;
|
2021-02-20 13:27:58 +08:00
|
|
|
|
using osu.Game.Rulesets.Osu.Mods;
|
2019-02-14 15:22:14 +08:00
|
|
|
|
using osu.Game.Tests.Beatmaps;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class OsuDifficultyCalculatorTest : DifficultyCalculatorTest
|
|
|
|
|
{
|
2023-12-07 14:38:15 +08:00
|
|
|
|
protected override string ResourceAssembly => "osu.Game.Rulesets.Osu.Tests";
|
2019-02-14 15:22:14 +08:00
|
|
|
|
|
2024-10-07 15:32:23 +08:00
|
|
|
|
[TestCase(6.7171144000821119d, 239, "diffcalc-test")]
|
|
|
|
|
[TestCase(1.4485749025771304d, 54, "zero-length-sliders")]
|
2024-10-04 20:48:48 +08:00
|
|
|
|
[TestCase(0.42630400627180914d, 4, "very-fast-slider")]
|
|
|
|
|
[TestCase(0.14143808967817237d, 2, "nan-slider")]
|
2022-01-23 11:25:22 +08:00
|
|
|
|
public void Test(double expectedStarRating, int expectedMaxCombo, string name)
|
|
|
|
|
=> base.Test(expectedStarRating, expectedMaxCombo, name);
|
2019-02-14 15:22:14 +08:00
|
|
|
|
|
2024-10-07 15:32:23 +08:00
|
|
|
|
[TestCase(8.9825709931204205d, 239, "diffcalc-test")]
|
|
|
|
|
[TestCase(1.7550169162648608d, 54, "zero-length-sliders")]
|
2024-10-04 20:48:48 +08:00
|
|
|
|
[TestCase(0.55231632896800109d, 4, "very-fast-slider")]
|
2022-01-23 11:25:22 +08:00
|
|
|
|
public void TestClockRateAdjusted(double expectedStarRating, int expectedMaxCombo, string name)
|
|
|
|
|
=> Test(expectedStarRating, expectedMaxCombo, name, new OsuModDoubleTime());
|
|
|
|
|
|
2024-10-07 15:32:23 +08:00
|
|
|
|
[TestCase(6.7171144000821119d, 239, "diffcalc-test")]
|
|
|
|
|
[TestCase(1.4485749025771304d, 54, "zero-length-sliders")]
|
2024-10-04 20:48:48 +08:00
|
|
|
|
[TestCase(0.42630400627180914d, 4, "very-fast-slider")]
|
2022-01-23 11:25:22 +08:00
|
|
|
|
public void TestClassicMod(double expectedStarRating, int expectedMaxCombo, string name)
|
|
|
|
|
=> Test(expectedStarRating, expectedMaxCombo, name, new OsuModClassic());
|
2021-02-20 13:27:58 +08:00
|
|
|
|
|
2021-11-15 17:42:47 +08:00
|
|
|
|
protected override DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap) => new OsuDifficultyCalculator(new OsuRuleset().RulesetInfo, beatmap);
|
2019-02-15 13:42:42 +08:00
|
|
|
|
|
|
|
|
|
protected override Ruleset CreateRuleset() => new OsuRuleset();
|
2019-02-14 15:22:14 +08:00
|
|
|
|
}
|
|
|
|
|
}
|