Class FixedClock
Mutable clock implementation used for deterministic scenarios such as tests.
public sealed class FixedClock : IClock
- Inheritance
-
FixedClock
- Implements
- Inherited Members
Constructors
FixedClock(DateTime)
Initializes a new fixed clock with an initial time value.
public FixedClock(DateTime now)
Parameters
nowDateTimeThe initial local time.
Properties
Now
Gets the current fixed local time.
public DateTime Now { get; }
Property Value
Methods
Advance(TimeSpan)
Advances the current fixed time by a delta.
public void Advance(TimeSpan delta)
Parameters
deltaTimeSpanThe time delta to add.
Set(DateTime)
Sets the current fixed time.
public void Set(DateTime now)
Parameters
nowDateTimeThe new local time.