Method FailTestCases
- Namespace
- Xunit.v3
- Assembly
- xunit.v3.core.dll
FailTestCases(IMessageBus, CancellationTokenSource, IReadOnlyCollection<ITestCase>, string, bool, bool, bool, bool, bool)
Fail a set of test cases with the given message.
public static RunSummary FailTestCases(IMessageBus messageBus, CancellationTokenSource cancellationTokenSource, IReadOnlyCollection<ITestCase> testCases, string messageFormat, bool sendTestCollectionMessages = false, bool sendTestClassMessages = false, bool sendTestMethodMessages = false, bool sendTestCaseMessages = true, bool sendTestMessages = true)
Parameters
messageBusThe message bus to send the messages to
cancellationTokenSourceCancellationTokenSourceThe cancellation token source to cancel if requested
testCasesIReadOnlyCollection<ITestCase>The test cases to fail
messageFormatstringA message template where
{0}will be replaced with the display name of the test case during failure processingsendTestCollectionMessagesboolSet to
trueto send ITestCollectionStarting and ITestCollectionFinished messages; set tofalseto skipsendTestClassMessagesboolSet to
trueto send ITestClassStarting and ITestClassFinished messages; set tofalseto skipsendTestMethodMessagesboolSet to
trueto send ITestMethodStarting and ITestMethodFinished messages; set tofalseto skipsendTestCaseMessagesboolSet to
trueto send ITestCaseStarting and ITestCaseFinished messages; set tofalseto skipsendTestMessagesboolSet to
trueto send ITestStarting and ITestFinished messages; set tofalseto skip
Returns
FailTestCases(IMessageBus, CancellationTokenSource, IReadOnlyCollection<ITestCase>, Exception, bool, bool, bool, bool, bool)
Fail a set of test cases with the given exception.
public static RunSummary FailTestCases(IMessageBus messageBus, CancellationTokenSource cancellationTokenSource, IReadOnlyCollection<ITestCase> testCases, Exception exception, bool sendTestCollectionMessages = false, bool sendTestClassMessages = false, bool sendTestMethodMessages = false, bool sendTestCaseMessages = true, bool sendTestMessages = true)
Parameters
messageBusThe message bus to send the messages to
cancellationTokenSourceCancellationTokenSourceThe cancellation token source to cancel if requested
testCasesIReadOnlyCollection<ITestCase>The test cases to fail
exceptionExceptionThe exception to fail the test cases with
sendTestCollectionMessagesboolSet to
trueto send ITestCollectionStarting and ITestCollectionFinished messages; set tofalseto skipsendTestClassMessagesboolSet to
trueto send ITestClassStarting and ITestClassFinished messages; set tofalseto skipsendTestMethodMessagesboolSet to
trueto send ITestMethodStarting and ITestMethodFinished messages; set tofalseto skipsendTestCaseMessagesboolSet to
trueto send ITestCaseStarting and ITestCaseFinished messages; set tofalseto skipsendTestMessagesboolSet to
trueto send ITestStarting and ITestFinished messages; set tofalseto skip