Table of Contents

Class EventuallyTimerAssertionExtensions

Namespace
TimeAssertions.TUnit
Assembly
TimeAssertions.TUnit.dll

The pre-0.10.0 pollingInterval forms of the "eventually" active-timer assertions, kept for source compatibility. Since 0.10.0 the waits are event-driven (they react to every timer change), so a polling interval has no effect; each overload forwards to the form without it.

[SuppressMessage("Info Code Smell", "S1133:Deprecated code should be removed", Justification = "Deliberate one-release deprecation window: these overloads are removed in 0.11.0, as their Obsolete message states.")]
public static class EventuallyTimerAssertionExtensions
Inheritance
EventuallyTimerAssertionExtensions
Inherited Members

Remarks

These overloads are hand-written rather than generated: the TUnit source generator does not carry an ObsoleteAttribute from an assertion constructor onto the generated extension, so a deprecated constructor would give callers no warning.

Methods

HasActiveTimerCountEventually(IAssertionSource<ObservableTimeProvider>, int, TimeSpan, TimeSpan?, CancellationToken, string?, string?)

Waits until the active-timer count equals count, or timeout passes.

[Obsolete("The wait is event-driven since 0.10.0, so pollingInterval has no effect; remove the argument. This overload will be removed in 0.11.0.")]
public static HasActiveTimerCountEventuallyAssertion HasActiveTimerCountEventually(this IAssertionSource<ObservableTimeProvider> source, int count, TimeSpan timeout, TimeSpan? pollingInterval, CancellationToken cancellationToken = default, string? countExpression = null, string? timeoutExpression = null)

Parameters

source IAssertionSource<ObservableTimeProvider>

The assertion source over an ObservableTimeProvider.

count int

The active-timer count to wait for. Must be non-negative.

timeout TimeSpan

The longest real time to wait. Must be non-negative and at most about 49.7 days (uint.MaxValue - 1 milliseconds).

pollingInterval TimeSpan?

Ignored; the wait is event-driven.

cancellationToken CancellationToken

A token that cancels the wait.

countExpression string

Captured automatically; the caller's count expression.

timeoutExpression string

Captured automatically; the caller's timeout expression.

Returns

HasActiveTimerCountEventuallyAssertion

The HasActiveTimerCountEventuallyAssertion chain.

HasActiveTimersEventually(IAssertionSource<ObservableTimeProvider>, TimeSpan, TimeSpan?, CancellationToken, string?)

Waits until at least one timer is active, or timeout passes.

[Obsolete("The wait is event-driven since 0.10.0, so pollingInterval has no effect; remove the argument. This overload will be removed in 0.11.0.")]
public static HasActiveTimersEventuallyAssertion HasActiveTimersEventually(this IAssertionSource<ObservableTimeProvider> source, TimeSpan timeout, TimeSpan? pollingInterval, CancellationToken cancellationToken = default, string? timeoutExpression = null)

Parameters

source IAssertionSource<ObservableTimeProvider>

The assertion source over an ObservableTimeProvider.

timeout TimeSpan

The longest real time to wait. Must be non-negative and at most about 49.7 days (uint.MaxValue - 1 milliseconds).

pollingInterval TimeSpan?

Ignored; the wait is event-driven.

cancellationToken CancellationToken

A token that cancels the wait.

timeoutExpression string

Captured automatically; the caller's timeout expression.

Returns

HasActiveTimersEventuallyAssertion

The HasActiveTimersEventuallyAssertion chain.

HasAtLeastActiveTimerCountEventually(IAssertionSource<ObservableTimeProvider>, int, TimeSpan, TimeSpan?, CancellationToken, string?, string?)

Waits until the active-timer count reaches at least count, or timeout passes.

[Obsolete("The wait is event-driven since 0.10.0, so pollingInterval has no effect; remove the argument. This overload will be removed in 0.11.0.")]
public static HasAtLeastActiveTimerCountEventuallyAssertion HasAtLeastActiveTimerCountEventually(this IAssertionSource<ObservableTimeProvider> source, int count, TimeSpan timeout, TimeSpan? pollingInterval, CancellationToken cancellationToken = default, string? countExpression = null, string? timeoutExpression = null)

Parameters

source IAssertionSource<ObservableTimeProvider>

The assertion source over an ObservableTimeProvider.

count int

The minimum active-timer count to wait for. Must be non-negative.

timeout TimeSpan

The longest real time to wait. Must be non-negative and at most about 49.7 days (uint.MaxValue - 1 milliseconds).

pollingInterval TimeSpan?

Ignored; the wait is event-driven.

cancellationToken CancellationToken

A token that cancels the wait.

countExpression string

Captured automatically; the caller's count expression.

timeoutExpression string

Captured automatically; the caller's timeout expression.

Returns

HasAtLeastActiveTimerCountEventuallyAssertion

The HasAtLeastActiveTimerCountEventuallyAssertion chain.

HasAtMostActiveTimerCountEventually(IAssertionSource<ObservableTimeProvider>, int, TimeSpan, TimeSpan?, CancellationToken, string?, string?)

Waits until the active-timer count falls to at most count, or timeout passes.

[Obsolete("The wait is event-driven since 0.10.0, so pollingInterval has no effect; remove the argument. This overload will be removed in 0.11.0.")]
public static HasAtMostActiveTimerCountEventuallyAssertion HasAtMostActiveTimerCountEventually(this IAssertionSource<ObservableTimeProvider> source, int count, TimeSpan timeout, TimeSpan? pollingInterval, CancellationToken cancellationToken = default, string? countExpression = null, string? timeoutExpression = null)

Parameters

source IAssertionSource<ObservableTimeProvider>

The assertion source over an ObservableTimeProvider.

count int

The maximum active-timer count to wait for. Must be non-negative.

timeout TimeSpan

The longest real time to wait. Must be non-negative and at most about 49.7 days (uint.MaxValue - 1 milliseconds).

pollingInterval TimeSpan?

Ignored; the wait is event-driven.

cancellationToken CancellationToken

A token that cancels the wait.

countExpression string

Captured automatically; the caller's count expression.

timeoutExpression string

Captured automatically; the caller's timeout expression.

Returns

HasAtMostActiveTimerCountEventuallyAssertion

The HasAtMostActiveTimerCountEventuallyAssertion chain.

HasNoActiveTimersEventually(IAssertionSource<ObservableTimeProvider>, TimeSpan, TimeSpan?, CancellationToken, string?)

Waits until no timer remains active, or timeout passes.

[Obsolete("The wait is event-driven since 0.10.0, so pollingInterval has no effect; remove the argument. This overload will be removed in 0.11.0.")]
public static HasNoActiveTimersEventuallyAssertion HasNoActiveTimersEventually(this IAssertionSource<ObservableTimeProvider> source, TimeSpan timeout, TimeSpan? pollingInterval, CancellationToken cancellationToken = default, string? timeoutExpression = null)

Parameters

source IAssertionSource<ObservableTimeProvider>

The assertion source over an ObservableTimeProvider.

timeout TimeSpan

The longest real time to wait. Must be non-negative and at most about 49.7 days (uint.MaxValue - 1 milliseconds).

pollingInterval TimeSpan?

Ignored; the wait is event-driven.

cancellationToken CancellationToken

A token that cancels the wait.

timeoutExpression string

Captured automatically; the caller's timeout expression.

Returns

HasNoActiveTimersEventuallyAssertion

The HasNoActiveTimersEventuallyAssertion chain.