Table of Contents

Class Record

Namespace
Asserts
Assembly
xunit.v3.assert.dll
public class Record
Inheritance
Record
Inherited Members

Methods

RecordException(Action)

Records any exception which is thrown by the given code.

protected static Exception? RecordException(Action testCode)

Parameters

testCode Action

The code which may thrown an exception.

Returns

Exception

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

Examples

Add an example for this method ?

Contribution guide.

RecordException(Func<object?>, string)

Records any exception which is thrown by the given code that has a return value. Generally used for testing property accessors.

protected static Exception? RecordException(Func<object?> testCode, string asyncMethodName)

Parameters

testCode Func<object>

The code which may thrown an exception.

asyncMethodName string

The name of the async method the user should've called if they accidentally passed in an async function

Returns

Exception

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

Examples

Add an example for this method ?

Contribution guide.

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.

Examples

Add an example for this method ?

Contribution guide.