xUnit.net
Static Public Member Functions | List of all members
Xunit.Record Class Reference

Allows the user to record actions for a test. More...

Static Public Member Functions

static Exception Exception (Action testCode)
 Records any exception which is thrown by the given code. More...
 
static Exception Exception (Func< object > testCode)
 Records any exception which is thrown by the given code that has a return value. Generally used for testing property accessors. More...
 
static Exception Exception (Func< Task > testCode)
 
static async Task< ExceptionExceptionAsync (Func< Task > testCode)
 Records any exception which is thrown by the given task. More...
 

Detailed Description

Allows the user to record actions for a test.

Member Function Documentation

◆ Exception() [1/2]

static Exception Xunit.Record.Exception ( Action  testCode)
inlinestatic

Records any exception which is thrown by the given code.

Parameters
testCodeThe code which may throw an exception.
Returns
Returns the exception that was thrown by the code; null, otherwise.

◆ Exception() [2/2]

static Exception Xunit.Record.Exception ( Func< object >  testCode)
inlinestatic

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

Parameters
testCodeThe code which may throw an exception.
Returns
Returns the exception that was thrown by the code; null, otherwise.

◆ ExceptionAsync()

static async Task<Exception> Xunit.Record.ExceptionAsync ( Func< Task >  testCode)
inlinestatic

Records any exception which is thrown by the given task.

Parameters
testCodeThe task which may throw an exception.
Returns
Returns the exception that was thrown by the code; null, otherwise.

The documentation for this class was generated from the following file: