2020-10-04 12:50:25 +00: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 System.Collections.Generic;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Timing;
|
|
|
|
using osu.Game.Screens.Play;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.NonVisual
|
|
|
|
{
|
|
|
|
[TestFixture]
|
2022-08-15 10:59:08 +00:00
|
|
|
public class GameplayClockContainerTest
|
2020-10-04 12:50:25 +00:00
|
|
|
{
|
|
|
|
[TestCase(0)]
|
|
|
|
[TestCase(1)]
|
|
|
|
public void TestTrueGameplayRateWithZeroAdjustment(double underlyingClockRate)
|
|
|
|
{
|
|
|
|
var framedClock = new FramedClock(new ManualClock { Rate = underlyingClockRate });
|
2022-08-15 10:46:29 +00:00
|
|
|
var gameplayClock = new TestGameplayClockContainer(framedClock);
|
2020-10-04 12:50:25 +00:00
|
|
|
|
|
|
|
Assert.That(gameplayClock.TrueGameplayRate, Is.EqualTo(0));
|
|
|
|
}
|
|
|
|
|
2022-08-15 10:46:29 +00:00
|
|
|
private class TestGameplayClockContainer : GameplayClockContainer
|
2020-10-04 12:50:25 +00:00
|
|
|
{
|
2022-08-15 10:46:29 +00:00
|
|
|
public override IEnumerable<double> NonGameplayAdjustments => new[] { 0.0 };
|
2020-10-04 12:50:25 +00:00
|
|
|
|
2022-08-15 10:46:29 +00:00
|
|
|
public TestGameplayClockContainer(IFrameBasedClock underlyingClock)
|
2020-10-04 12:50:25 +00:00
|
|
|
: base(underlyingClock)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|