Table of Contents

Method RecordExceptionAsync

Namespace
Xunit
Assembly
xunit.v3.assert.dll

RecordExceptionAsync(Func<Task>)

Records any exception which is thrown by the given task.

protected static Task<Exception?> RecordExceptionAsync(Func<Task> testCode)

Parameters

testCode Func<Task>

The task which may thrown an exception.

Returns

Task<Exception>

Returns the exception that was thrown by the code; null, otherwise.