Class VirtualTimeProvider
Virtual time provider for testing - all time is controlled.
public class VirtualTimeProvider : ITimeProvider
- Inheritance
-
VirtualTimeProvider
- Implements
- Inherited Members
Properties
- Now
Gets the current date/time. In tests, this can be controlled.
Methods
- Advance(TimeSpan)
Advances virtual time by the specified duration. This triggers any timers/delays that should fire.
- CreateTimer(TimeSpan, Action)
Creates a timer that fires periodically.
- Delay(TimeSpan, CancellationToken)
Creates a delay. In tests, this can be instant or controlled.
- SetTime(DateTime)
Sets virtual time to a specific value.