Class MockAsyncEnumerator<T>
Adapts a synchronous enumerator to IAsyncEnumerator<T> for EF Core async query testing.
Inherited Members
Namespace: FastMoq.Models
Assembly: FastMoq.Database.dll
Syntax
public class MockAsyncEnumerator<T> : IAsyncEnumerator<T>, IAsyncDisposable
Type Parameters
| Name | Description |
|---|---|
| T | The element type returned by the enumerator. |
Constructors
MockAsyncEnumerator(IEnumerator<T>)
Initializes the async enumerator wrapper.
Declaration
public MockAsyncEnumerator(IEnumerator<T> inner)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerator<T> | inner | The underlying synchronous enumerator. |
Properties
Current
Gets the current element in the underlying enumeration.
Declaration
public T Current { get; }
Property Value
| Type | Description |
|---|---|
| T |
Methods
DisposeAsync()
Disposes the underlying synchronous enumerator.
Declaration
public ValueTask DisposeAsync()
Returns
| Type | Description |
|---|---|
| ValueTask | A completed ValueTask. |
MoveNextAsync()
Advances the underlying enumerator to the next element.
Declaration
public ValueTask<bool> MoveNextAsync()
Returns
| Type | Description |
|---|---|
| ValueTask<bool> | A ValueTask<TResult> whose result indicates whether the enumerator advanced successfully. |