Class Record
- Namespace
- Xunit
- Assembly
- xunit.v3.core.dll
Allows the user to record actions for a test.
public static class Record
- Inheritance
-
Record
- Inherited Members
Methods
Exception(Action)
Records any exception which is thrown by the given code.
public static Exception? Exception(Action testCode)
Parameters
testCodeActionThe code which may throw an exception.
Returns
- Exception
Returns the exception that was thrown by the code; null, otherwise.
Exception(Func<object?>)
Records any exception which is thrown by the given code that has a return value. Generally used for testing property accessors.
public static Exception? Exception(Func<object?> testCode)
Parameters
Returns
- Exception
Returns the exception that was thrown by the code; null, otherwise.
ExceptionAsync(Func<Task>)
Records any exception which is thrown by the given task.
public static ValueTask<Exception?> ExceptionAsync(Func<Task> testCode)