xUnit.net
All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Member Functions | Protected Member Functions | Properties | List of all members
Xunit.Sdk.ThrowsException Class Reference

Exception thrown when code unexpectedly fails to throw an exception. More...

Inheritance diagram for Xunit.Sdk.ThrowsException:
Xunit.Sdk.AssertActualExpectedException Xunit.Sdk.XunitException

Public Member Functions

 ThrowsException (Type expectedType)
 Creates a new instance of the ThrowsException class. Call this constructor when no exception was thrown. More...
 
 ThrowsException (Type expectedType, Exception actual)
 Creates a new instance of the ThrowsException class. Call this constructor when an exception of the wrong type was thrown. More...
 
- Public Member Functions inherited from Xunit.Sdk.AssertActualExpectedException
 AssertActualExpectedException (object expected, object actual, string userMessage, string expectedTitle=null, string actualTitle=null)
 Creates a new instance of the class. More...
 
 AssertActualExpectedException (object expected, object actual, string userMessage, string expectedTitle, string actualTitle, Exception innerException)
 Creates a new instance of the class. More...
 
- Public Member Functions inherited from Xunit.Sdk.XunitException
 XunitException ()
 Initializes a new instance of the XunitException class. More...
 
 XunitException (string userMessage)
 Initializes a new instance of the XunitException class. More...
 
override string ToString ()
 

Protected Member Functions

 ThrowsException? (Type expected, string actual, string actualMessage, string stackTrace, Exception innerException)
 THIS CONSTRUCTOR IS FOR UNIT TESTING PURPOSES ONLY. More...
 
- Protected Member Functions inherited from Xunit.Sdk.XunitException
 XunitException (string userMessage, Exception innerException)
 Initializes a new instance of the XunitException class. More...
 
 XunitException (string userMessage, string stackTrace)
 Initializes a new instance of the XunitException class. More...
 

Properties

override string?? StackTrace [get]
 Gets a string representation of the frames on the call stack at the time the current exception was thrown. More...
 
- Properties inherited from Xunit.Sdk.AssertActualExpectedException
string Actual [get]
 Gets the actual value. More...
 
string ActualTitle [get]
 Gets the title used for the actual value. More...
 
string Expected [get]
 Gets the expected value. More...
 
string ExpectedTitle [get]
 Gets the title used for the expected value. More...
 
override string???? Message [get]
 Gets a message that describes the current exception. Includes the expected and actual values. More...
 
- Properties inherited from Xunit.Sdk.XunitException
override string?? StackTrace [get]
 Gets a string representation of the frames on the call stack at the time the current exception was thrown. More...
 
string UserMessage [get, protected set]
 Gets the user message More...
 

Detailed Description

Exception thrown when code unexpectedly fails to throw an exception.

Constructor & Destructor Documentation

◆ ThrowsException() [1/2]

Xunit.Sdk.ThrowsException.ThrowsException ( Type  expectedType)
inline

Creates a new instance of the ThrowsException class. Call this constructor when no exception was thrown.

Parameters
expectedTypeThe type of the exception that was expected

◆ ThrowsException() [2/2]

Xunit.Sdk.ThrowsException.ThrowsException ( Type  expectedType,
Exception  actual 
)
inline

Creates a new instance of the ThrowsException class. Call this constructor when an exception of the wrong type was thrown.

Parameters
expectedTypeThe type of the exception that was expected
actualThe actual exception that was thrown

Member Function Documentation

◆ ThrowsException?()

Xunit.Sdk.ThrowsException.ThrowsException? ( Type  expected,
string  actual,
string  actualMessage,
string  stackTrace,
Exception  innerException 
)
inlineprotected

THIS CONSTRUCTOR IS FOR UNIT TESTING PURPOSES ONLY.

Property Documentation

◆ StackTrace

override string?? Xunit.Sdk.ThrowsException.StackTrace
get

Gets a string representation of the frames on the call stack at the time the current exception was thrown.

Returns
A string that describes the contents of the call stack, with the most recent method call appearing first.

The documentation for this class was generated from the following file: