C# Класс Google.Api.Gax.Testing.FakeClock

Implementation of IClock which allows manually-specified times and increments.
This implementation is thread-safe.
Наследование: IClock
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Advance ( System.TimeSpan timeSpan ) : void

Advances the clock by the given time span.

Advance ( long ticks ) : void

Advances the clock by the given number of ticks.

AdvanceTo ( System.DateTime dateTime ) : void

Advances the clock to the given time.

FakeClock ( ) : System

Creates an instance with an initial time of 2000-01-01T00:00:00Z.

FakeClock ( System.DateTime dateTime ) : System

Creates an instance with the specified initial time, which must have a kind of Utc or Unspecified (the latter being for convenience).

FakeClock ( long ticks ) : System

Creates an instance with the specified number of ticks since 0001-01-1T00:00:00Z as the initial time, for convenience when testing code with numeric values.

GetCurrentDateTimeUtc ( ) : System.DateTime

Returns the current date and time in UTC, with a kind of DateTimeKind.Utc.

Описание методов

Advance() публичный Метод

Advances the clock by the given time span.
public Advance ( System.TimeSpan timeSpan ) : void
timeSpan System.TimeSpan Time span to advance the clock by.
Результат void

Advance() публичный Метод

Advances the clock by the given number of ticks.
public Advance ( long ticks ) : void
ticks long Ticks to advance the clock by.
Результат void

AdvanceTo() публичный Метод

Advances the clock to the given time.
public AdvanceTo ( System.DateTime dateTime ) : void
dateTime System.DateTime The time to advance to.
Результат void

FakeClock() публичный Метод

Creates an instance with an initial time of 2000-01-01T00:00:00Z.
public FakeClock ( ) : System
Результат System

FakeClock() публичный Метод

Creates an instance with the specified initial time, which must have a kind of Utc or Unspecified (the latter being for convenience).
public FakeClock ( System.DateTime dateTime ) : System
dateTime System.DateTime The initial time for the clock.
Результат System

FakeClock() публичный Метод

Creates an instance with the specified number of ticks since 0001-01-1T00:00:00Z as the initial time, for convenience when testing code with numeric values.
public FakeClock ( long ticks ) : System
ticks long
Результат System

GetCurrentDateTimeUtc() публичный Метод

Returns the current date and time in UTC, with a kind of DateTimeKind.Utc.
public GetCurrentDateTimeUtc ( ) : System.DateTime
Результат System.DateTime