Class TestFailedException
The exception that is thrown when a test fails.
[Serializable]
public class TestFailedException : WorkflowException, ISerializable, _Exception
- Inheritance
-
TestFailedException
- Implements
- Inherited Members
- Extension Methods
Constructors
TestFailedException()
Initializes a new instance of the TestFailedException class.
public TestFailedException()
TestFailedException(SerializationInfo, StreamingContext)
Initializes a new instance of the TestFailedException class with serialized data.
protected TestFailedException(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoThe SerializationInfo that holds the serialized object data about the exception being thrown.
context
StreamingContextThe StreamingContext that contains contextual information about the source or destination.
Exceptions
TestFailedException(string)
Initializes a new instance of the TestFailedException class with a specified error message.
public TestFailedException(string message)
Parameters
message
stringThe message that describes the error.
TestFailedException(string, Exception)
Initializes a new instance of the TestFailedException class with a specified error message and a reference to the inner exception that is the cause of this exception.
public TestFailedException(string message, Exception inner)
Parameters
message
stringThe message that describes the error.
inner
ExceptionThe exception that is the cause of the current exception, or null if no inner exception is specified.
TestFailedException(string, string)
Initializes a new instance of the TestFailedException class with a specified error message and test fail reason.
public TestFailedException(string message, string reason)
Parameters
TestFailedException(string, string, Exception)
Initializes a new instance of the TestFailedException class with a specified error message, test fail reason, and a reference to the inner exception that is the cause of this exception.
public TestFailedException(string message, string reason, Exception inner)
Parameters
message
stringThe message that describes the error.
reason
stringThe test failure reason.
inner
ExceptionThe exception that is the cause of the current exception, or null if no inner exception is specified.
Properties
Reason
Gets the test failure reason.
public string Reason { get; }
Property Value
Methods
CreateFromReason(string)
[Obsolete("This is deprecated and will be removed in a future version; CreateLoggedFromReason should be used instead.")]
public static TestFailedException CreateFromReason(string reason)
Parameters
reason
string
Returns
CreateFromReason(string, Exception)
[Obsolete("This is deprecated and will be removed in a future version; CreateLoggedFromReason should be used instead.")]
public static TestFailedException CreateFromReason(string reason, Exception inner)
Parameters
Returns
CreateLogged(ITestLog)
public static TestFailedException CreateLogged(ITestLog testLog)
Parameters
testLog
ITestLog
Returns
CreateLogged(ITestLog, string, string)
public static TestFailedException CreateLogged(ITestLog testLog, string message, string reason)
Parameters
Returns
CreateLogged(ITestLog, string, string, Exception)
public static TestFailedException CreateLogged(ITestLog testLog, string message, string reason, Exception inner)
Parameters
Returns
CreateLoggedFromReason(ITestLog, string)
public static TestFailedException CreateLoggedFromReason(ITestLog testLog, string reason)
Parameters
Returns
CreateLoggedFromReason(ITestLog, string, Exception)
public static TestFailedException CreateLoggedFromReason(ITestLog testLog, string reason, Exception inner)
Parameters
Returns
GetObjectData(SerializationInfo, StreamingContext)
When overridden in a derived class, sets the SerializationInfo with information about the exception.
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoThe SerializationInfo that holds the serialized object data about the exception being thrown.
context
StreamingContextThe StreamingContext that contains contextual information about the source or destination.
Exceptions
- ArgumentNullException
The
info
parameter is a null reference (Nothing
in Visual Basic).
LogIfNotLoggedYet(ITestLog)
Logs this exception to a test log if it has not yet been logged to any test log via this method.
public TestFailedException LogIfNotLoggedYet(ITestLog testLog)
Parameters
Returns
- TestFailedException
This instance.