test: cover watch-time tracking, notices and storage

This commit is contained in:
2026-11-13 18:10:41 +01:00
parent 1cc93c5250
commit 66593e9da2
9 changed files with 863 additions and 0 deletions
@@ -0,0 +1,23 @@
namespace Jellyfin.Plugin.Herald.Tests;
/// <summary>
/// A clock the tests move by hand.
/// </summary>
public sealed class ManualTimeProvider : TimeProvider
{
private DateTimeOffset _now;
public ManualTimeProvider(DateTimeOffset now, TimeZoneInfo? zone = null)
{
_now = now;
LocalTimeZone = zone ?? TimeZoneInfo.Utc;
}
public override TimeZoneInfo LocalTimeZone { get; }
public override DateTimeOffset GetUtcNow() => _now;
public void Advance(TimeSpan by) => _now += by;
public void Set(DateTimeOffset now) => _now = now;
}