2020-03-03 12:36:55 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
2020-03-05 23:10:05 +08:00
|
|
|
using osu.Framework.Utils;
|
2020-03-03 12:36:55 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Mods;
|
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Tests.Mods
|
|
|
|
{
|
2020-03-05 23:10:05 +08:00
|
|
|
public class TestSceneOsuModDoubleTime : ModTestScene
|
2020-03-03 12:36:55 +08:00
|
|
|
{
|
|
|
|
[TestCase(0.5)]
|
|
|
|
[TestCase(1.01)]
|
|
|
|
[TestCase(1.5)]
|
|
|
|
[TestCase(2)]
|
|
|
|
[TestCase(5)]
|
2020-03-05 23:10:05 +08:00
|
|
|
public void TestSpeedChangeCustomisation(double rate)
|
2020-03-03 12:36:55 +08:00
|
|
|
{
|
2020-03-05 23:10:05 +08:00
|
|
|
var mod = new OsuModDoubleTime { SpeedChange = { Value = rate } };
|
2020-03-03 12:36:55 +08:00
|
|
|
|
2020-03-05 23:10:05 +08:00
|
|
|
CreateModTest(new ModTestData
|
2020-03-03 12:36:55 +08:00
|
|
|
{
|
2020-03-05 23:10:05 +08:00
|
|
|
Mod = mod,
|
|
|
|
PassCondition = () => Player.ScoreProcessor.JudgedHits >= 2 &&
|
|
|
|
Precision.AlmostEquals(Player.GameplayClockContainer.GameplayClock.Rate, mod.SpeedChange.Value)
|
|
|
|
});
|
2020-03-03 12:36:55 +08:00
|
|
|
}
|
2020-04-17 15:56:01 +08:00
|
|
|
|
|
|
|
protected override Ruleset CreateRuleset() => new OsuRuleset();
|
2020-03-03 12:36:55 +08:00
|
|
|
}
|
|
|
|
}
|