<PackageReference Include="Polly" Version="5.0.5" />

SystemClock

public static class SystemClock
Time related delegates used to support different compilation targets and to improve testability of the code.

Allows the setting of a custom Thread.Sleep implementation for testing. By default this will use the CancellationToken's WaitHandle.

Allows the setting of a custom async Sleep implementation for testing. By default this will be a call to Delay taking a CancellationToken

public static Func<DateTime> UtcNow

Allows the setting of a custom DateTime.UtcNow implementation for testing. By default this will be a call to UtcNow

public static void Reset()

Resets the custom implementations to their defaults. Should be called during test teardowns.