Files

14 lines
517 B
C#

namespace Elternbeirat.Web.Tests;
/// <summary>
/// A clock that always shows the same moment, so tests can decide what "today" is
/// (e.g. before or after the fixture's events). Hand-written instead of
/// Microsoft.Extensions.TimeProvider.Testing: overriding one method does not justify
/// a new package.
/// </summary>
/// <param name="now">The moment the clock shows.</param>
internal sealed class FixedTimeProvider(DateTimeOffset now) : TimeProvider
{
public override DateTimeOffset GetUtcNow() => now;
}