Aggregates exceptions. Intended to run one or more code blocks, and collect the exceptions thrown by those code blocks.
More...
|
bool | HasExceptions [get] |
| Returns true if the aggregator has at least one exception inside it. More...
|
|
Aggregates exceptions. Intended to run one or more code blocks, and collect the exceptions thrown by those code blocks.
◆ ExceptionAggregator() [1/2]
Xunit.Sdk.ExceptionAggregator.ExceptionAggregator |
( |
| ) |
|
|
inline |
◆ ExceptionAggregator() [2/2]
Initializes a new instance of the ExceptionAggregator class that contains the exception list of its parent.
- Parameters
-
parent | The parent aggregator to copy exceptions from. |
◆ Add()
void Xunit.Sdk.ExceptionAggregator.Add |
( |
Exception |
ex | ) |
|
|
inline |
Adds an exception to the aggregator.
- Parameters
-
ex | The exception to be added. |
◆ Aggregate()
Adds exceptions from another aggregator into this aggregator.
- Parameters
-
aggregator | The aggregator whose exceptions should be copied. |
◆ Clear()
void Xunit.Sdk.ExceptionAggregator.Clear |
( |
| ) |
|
|
inline |
◆ Run()
void Xunit.Sdk.ExceptionAggregator.Run |
( |
Action |
code | ) |
|
|
inline |
Runs the code, catching the exception that is thrown and adding it to the aggregate.
- Parameters
-
◆ RunAsync()
async Task Xunit.Sdk.ExceptionAggregator.RunAsync |
( |
Func< Task > |
code | ) |
|
|
inline |
Runs the code, catching the exception that is thrown and adding it to the aggregate.
- Parameters
-
◆ RunAsync< T >()
Runs the code, catching the exception that is thrown and adding it to the aggregate.
- Parameters
-
◆ ToException()
Exception Xunit.Sdk.ExceptionAggregator.ToException |
( |
| ) |
|
|
inline |
Returns an exception that represents the exceptions thrown by the code passed to the Run or RunAsync method.
- Returns
- Returns
null
if no exceptions were thrown; returns the exact exception if a single exception was thrown; returns AggregateException if more than one exception was thrown.
◆ HasExceptions
bool Xunit.Sdk.ExceptionAggregator.HasExceptions |
|
get |
Returns true
if the aggregator has at least one exception inside it.
The documentation for this class was generated from the following file:
- xunit/src/xunit.core/Sdk/ExceptionAggregator.cs