1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 16:25:32 +08:00
osu-lazer/osu.Game.Tests/NonVisual/GameplayClockContainerTest.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1.2 KiB
C#
Raw Normal View History

2020-10-04 20:50:25 +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;
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
2020-10-04 20:50:25 +08:00
using osu.Framework.Timing;
using osu.Game.Screens.Play;
namespace osu.Game.Tests.NonVisual
{
[TestFixture]
public partial class GameplayClockContainerTest
2020-10-04 20:50:25 +08:00
{
[TestCase(0)]
[TestCase(1)]
public void TestTrueGameplayRateWithGameplayAdjustment(double underlyingClockRate)
2020-10-04 20:50:25 +08:00
{
2023-10-07 01:43:00 +08:00
var trackVirtual = new TrackVirtual(60000) { Frequency = { Value = underlyingClockRate } };
var gameplayClock = new TestGameplayClockContainer(trackVirtual);
2020-10-04 20:50:25 +08:00
Assert.That(gameplayClock.GetTrueGameplayRate(), Is.EqualTo(2));
2020-10-04 20:50:25 +08:00
}
private partial class TestGameplayClockContainer : GameplayClockContainer
2020-10-04 20:50:25 +08:00
{
public TestGameplayClockContainer(IClock underlyingClock)
: base(underlyingClock, false, false)
2020-10-04 20:50:25 +08:00
{
AdjustmentsFromMods.AddAdjustment(AdjustableProperty.Frequency, new BindableDouble(2.0));
2020-10-04 20:50:25 +08:00
}
}
}
}