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
Properties
Section titled “Properties”public PollExpectation<T> Not { get; }The same matchers, negated.
Value: PollExpectation<T>
Methods
Section titled “Methods”ToBeAsync(T, CancellationToken)
Section titled “ToBeAsync(T, CancellationToken)”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
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