Table of Contents

Class FixedClock

Namespace
Xui.Core.Abstract
Assembly
Xui.Core.dll

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

now DateTime

The initial local time.

Properties

Now

Gets the current fixed local time.

public DateTime Now { get; }

Property Value

DateTime

Methods

Advance(TimeSpan)

Advances the current fixed time by a delta.

public void Advance(TimeSpan delta)

Parameters

delta TimeSpan

The time delta to add.

Set(DateTime)

Sets the current fixed time.

public void Set(DateTime now)

Parameters

now DateTime

The new local time.