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
sourceIAssertionSource<ObservableTimeProvider>The assertion source over an ObservableTimeProvider.
countintThe active-timer count to wait for. Must be non-negative.
timeoutTimeSpanThe longest real time to wait. Must be non-negative and at most about 49.7 days (
uint.MaxValue - 1milliseconds).pollingIntervalTimeSpan?Ignored; the wait is event-driven.
cancellationTokenCancellationTokenA token that cancels the wait.
countExpressionstringCaptured automatically; the caller's
countexpression.timeoutExpressionstringCaptured automatically; the caller's
timeoutexpression.
Returns
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
sourceIAssertionSource<ObservableTimeProvider>The assertion source over an ObservableTimeProvider.
timeoutTimeSpanThe longest real time to wait. Must be non-negative and at most about 49.7 days (
uint.MaxValue - 1milliseconds).pollingIntervalTimeSpan?Ignored; the wait is event-driven.
cancellationTokenCancellationTokenA token that cancels the wait.
timeoutExpressionstringCaptured automatically; the caller's
timeoutexpression.
Returns
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
sourceIAssertionSource<ObservableTimeProvider>The assertion source over an ObservableTimeProvider.
countintThe minimum active-timer count to wait for. Must be non-negative.
timeoutTimeSpanThe longest real time to wait. Must be non-negative and at most about 49.7 days (
uint.MaxValue - 1milliseconds).pollingIntervalTimeSpan?Ignored; the wait is event-driven.
cancellationTokenCancellationTokenA token that cancels the wait.
countExpressionstringCaptured automatically; the caller's
countexpression.timeoutExpressionstringCaptured automatically; the caller's
timeoutexpression.
Returns
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
sourceIAssertionSource<ObservableTimeProvider>The assertion source over an ObservableTimeProvider.
countintThe maximum active-timer count to wait for. Must be non-negative.
timeoutTimeSpanThe longest real time to wait. Must be non-negative and at most about 49.7 days (
uint.MaxValue - 1milliseconds).pollingIntervalTimeSpan?Ignored; the wait is event-driven.
cancellationTokenCancellationTokenA token that cancels the wait.
countExpressionstringCaptured automatically; the caller's
countexpression.timeoutExpressionstringCaptured automatically; the caller's
timeoutexpression.
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
sourceIAssertionSource<ObservableTimeProvider>The assertion source over an ObservableTimeProvider.
timeoutTimeSpanThe longest real time to wait. Must be non-negative and at most about 49.7 days (
uint.MaxValue - 1milliseconds).pollingIntervalTimeSpan?Ignored; the wait is event-driven.
cancellationTokenCancellationTokenA token that cancels the wait.
timeoutExpressionstringCaptured automatically; the caller's
timeoutexpression.