Class ProtoCleanupException
The failure a runner reports when cleanup failed and Fail is in effect. A body that passed produces a message that says so and names the first cleanup failure; further failures are counted. A body that failed stays the primary error: its message leads, it is the InnerException, and CleanupFailures carries the cleanup.
public sealed class ProtoCleanupException : Exception, ISerializable
- Inheritance
-
ProtoCleanupException
- Implements
- Inherited Members
- Extension Methods
Properties
BodyPassed
Whether the test body itself passed and this failure exists only because cleanup failed.
public bool BodyPassed { get; }
Property Value
CleanupFailures
The cleanup failures, in the order teardown observed them.
public IReadOnlyList<Exception> CleanupFailures { get; }
Property Value
Methods
AfterBodyFailure(IReadOnlyList<Exception>)
A failure that carries only the cleanup, for a runner that already reports the body's own failure next to it (xUnit v3 adds an after-test failure to the body's). The message names the first cleanup failure and counts the rest; it does not repeat the body's.
public static ProtoCleanupException AfterBodyFailure(IReadOnlyList<Exception> cleanupFailures)
Parameters
cleanupFailuresIReadOnlyList<Exception>
Returns
ForBodyFailure(ProtoTestResult, Exception)
A failure whose message and inner exception are the body's own failure, with the cleanup failures attached after it.
public static ProtoCleanupException ForBodyFailure(ProtoTestResult result, Exception cleanup)
Parameters
resultProtoTestResultcleanupException
Returns
ForPassedBody(IReadOnlyList<Exception>)
A failure for a body that passed. The message names the first cleanup failure and counts the rest.
public static ProtoCleanupException ForPassedBody(IReadOnlyList<Exception> cleanupFailures)
Parameters
cleanupFailuresIReadOnlyList<Exception>
Returns
ForPassedBody(Exception)
A failure for a body that passed. The message names the first cleanup failure and counts the rest.
public static ProtoCleanupException ForPassedBody(Exception cleanup)
Parameters
cleanupException