StubHttp.VerifyAllCalledAsync() method¶
Defined in
Type: StubHttp
Namespace: Refit.Testing
Assembly: Refit.Testing.dll
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481, net471
Overloads¶
- 1.
public Task VerifyAllCalledAsync() - 2.
public Task VerifyAllCalledAsync(TimeSpan timeout)
1. Overload¶
public Task VerifyAllCalledAsync()
Summary: Asynchronously waits (up to a default 1 second) for every non-reusable route to be hit, then asserts. Use this when the requests under test are fired-and-forget (e.g. an observable subscription or a background send) and may not have completed at the point of verification.
Returns: Task -- A task that completes when all routes are hit, or faults with the outstanding list on timeout.
2. Overload¶
public Task VerifyAllCalledAsync(TimeSpan timeout)
Summary: Asynchronously waits up to timeout for every non-reusable route to be hit, then asserts.
Parameters
| Name | Type | Description |
|---|---|---|
timeout | TimeSpan | How long to wait for the outstanding requests to arrive before asserting. |
Returns: Task -- A task that completes when all routes are hit, or faults with the outstanding list on timeout.
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | One or more expected routes were not hit within the timeout. |