<commit_before>// Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using NUnit.Framework;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
using osu.Game.Tests.Visual;

namespace osu.Game.Rulesets.Osu.Tests.Mods
{
    public class TestSceneOsuModDoubleTime : ModSandboxTestScene
    {
        public TestSceneOsuModDoubleTime()
            : base(new OsuRuleset())
        {
        }

        [TestCase(0.5)]
        [TestCase(1.01)]
        [TestCase(1.5)]
        [TestCase(2)]
        [TestCase(5)]
        public void TestDefaultRate(double rate) => CreateModTest(new ModTestCaseData("1.5x", new OsuModDoubleTime { SpeedChange = { Value = rate } })
        {
            PassCondition = () => ((ScoreAccessibleTestPlayer)Player).ScoreProcessor.JudgedHits >= 2
        });

        protected override TestPlayer CreateReplayPlayer(Score score) => new ScoreAccessibleTestPlayer(score);

        private class ScoreAccessibleTestPlayer : TestPlayer
        {
            public new ScoreProcessor ScoreProcessor => base.ScoreProcessor;

            public ScoreAccessibleTestPlayer(Score score)
                : base(score)
            {
            }
        }
    }
}<commit_msg>Actually check rate is applied<commit_after>// Copyright (c) <NAME> <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using NUnit.Framework;
using osu.Framework.Utils;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Tests.Visual;

namespace osu.Game.Rulesets.Osu.Tests.Mods
{
    public class TestSceneOsuModDoubleTime : ModTestScene
    {
        public TestSceneOsuModDoubleTime()
            : base(new OsuRuleset())
        {
        }

        [TestCase(0.5)]
        [TestCase(1.01)]
        [TestCase(1.5)]
        [TestCase(2)]
        [TestCase(5)]
        public void TestSpeedChangeCustomisation(double rate)
        {
            var mod = new OsuModDoubleTime { SpeedChange = { Value = rate } };

            CreateModTest(new ModTestData
            {
                Mod = mod,
                PassCondition = () => Player.ScoreProcessor.JudgedHits >= 2 &&
                                      Precision.AlmostEquals(Player.GameplayClockContainer.GameplayClock.Rate, mod.SpeedChange.Value)
            });
        }
    }
}
{'fraction_non_alphanumeric': 0.10078479966955803, 'fraction_numerical': 0.009087154068566708, 'mean_word_length': 2.308743169398907, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2274651', 'n_tokens_mistral': 710, 'n_tokens_neox': 687, 'n_words': 152}