1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 21:27:24 +08:00
osu-lazer/osu.Game.Tests/NonVisual/SessionStaticsTest.cs

38 lines
1.7 KiB
C#
Raw Normal View History

2021-04-19 11:04:28 +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.Game.Configuration;
namespace osu.Game.Tests.NonVisual
{
[TestFixture]
public class SessionStaticsTest
{
private SessionStatics sessionStatics;
[Test]
public void TestSessionStaticsReset()
2021-04-19 11:04:28 +08:00
{
sessionStatics = new SessionStatics();
sessionStatics.SetValue(Static.LoginOverlayDisplayed, true);
sessionStatics.SetValue(Static.MutedAudioNotificationShownOnce, true);
sessionStatics.SetValue(Static.LowBatteryNotificationShownOnce, true);
sessionStatics.SetValue(Static.LastHoverSoundPlaybackTime, (double?)1d);
Assert.IsFalse(sessionStatics.GetBindable<bool>(Static.LoginOverlayDisplayed).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<bool>(Static.MutedAudioNotificationShownOnce).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<bool>(Static.LowBatteryNotificationShownOnce).IsDefault);
Assert.IsFalse(sessionStatics.GetBindable<double?>(Static.LastHoverSoundPlaybackTime).IsDefault);
2021-04-19 11:04:28 +08:00
sessionStatics.ResetAfterInactivity();
Assert.IsTrue(sessionStatics.GetBindable<bool>(Static.LoginOverlayDisplayed).IsDefault);
Assert.IsTrue(sessionStatics.GetBindable<bool>(Static.MutedAudioNotificationShownOnce).IsDefault);
Assert.IsTrue(sessionStatics.GetBindable<bool>(Static.LowBatteryNotificationShownOnce).IsDefault);
Assert.IsTrue(sessionStatics.GetBindable<double?>(Static.LastHoverSoundPlaybackTime).IsDefault);
2021-04-19 11:04:28 +08:00
}
}
}