Open sandboxFocus

Method AssertNotNullAsync

AssertNotNullAsync<T>(Task<T?>?, string?)

Checks that a Task and its result are non-null and throws an AssertionFailedException if it is not.

Declaration
public static Task<T> AssertNotNullAsync<T>(this Task<T?>? task, string? description = null) where T : class
Parameters
Type Name Description
Task<T> task
string description
Returns
Type Description
Task<T>
Type Parameters
Name Description
T

AssertNotNullAsync<T>(ValueTask<T?>, string?)

Declaration
public static ValueTask<T> AssertNotNullAsync<T>(this ValueTask<T?> task, string? description = null) where T : class
Parameters
Type Name Description
ValueTask<T> task
string description
Returns
Type Description
ValueTask<T>
Type Parameters
Name Description
T