Skip to content

PollExpectation<T>

Namespace: E2E

public sealed class PollExpectation<T>

Re-reads a value until the chosen matcher holds or the timeout passes. A read that throws is retried, and its error is reported if the poll times out. A matcher that refuses the read value’s type counts as not yet. With NUnit, ToMatchAsync from E2E.NUnit takes any NUnit constraint.

Type parameters

Name Description
T

Inheritance: object

View source

public PollExpectation<T> Not { get; }

The same matchers, negated.

Value: PollExpectation<T>

View source

public Task ToBeAsync(T expected, CancellationToken cancellationToken = default)

Passes when the read value equals <code class=“paramref”>expected</code> by Default.

Parameters

Name Type Description
expected T
cancellationToken CancellationToken

Returns: Task

View source

ToSatisfyAsync(Func<T, bool>, string?, CancellationToken)

Section titled “ToSatisfyAsync(Func<T, bool>, string?, CancellationToken)”
public Task ToSatisfyAsync(Func<T, bool> predicate, string? description = null, CancellationToken cancellationToken = default)

Passes when <code class=“paramref”>predicate</code> returns true for the read value. <code class=“paramref”>description</code> names the condition in the error.

Parameters

Name Type Description
predicate Func<T, bool>
description string
cancellationToken CancellationToken

Returns: Task

View source