Class ThrowsException
Exception thrown when code unexpectedly fails to throw an exception.
Inherited Members
Namespace: Xunit.Sdk
Assembly: xunit.assert.dll
Syntax
public class ThrowsException : AssertActualExpectedException
Constructors
| Improve this Doc View SourceThrowsException(Type)
Creates a new instance of the ThrowsException class. Call this constructor when no exception was thrown.
Declaration
public ThrowsException(Type expectedType)
Parameters
Type | Name | Description |
---|---|---|
Type | expectedType | The type of the exception that was expected |
ThrowsException(Type, Exception)
Creates a new instance of the ThrowsException class. Call this constructor when an exception of the wrong type was thrown.
Declaration
public ThrowsException(Type expectedType, Exception actual)
Parameters
Type | Name | Description |
---|---|---|
Type | expectedType | The type of the exception that was expected |
Exception | actual | The actual exception that was thrown |
ThrowsException(Type, String, String, String, Exception)
THIS CONSTRUCTOR IS FOR UNIT TESTING PURPOSES ONLY.
Declaration
protected ThrowsException(Type expected, string actual, string actualMessage, string stackTrace, Exception innerException)
Parameters
Type | Name | Description |
---|---|---|
Type | expected | |
String | actual | |
String | actualMessage | |
String | stackTrace | |
Exception | innerException |
Properties
| Improve this Doc View SourceStackTrace
Gets a string representation of the frames on the call stack at the time the current exception was thrown.
Declaration
public override string StackTrace { get; }
Property Value
Type | Description |
---|---|
String | A string that describes the contents of the call stack, with the most recent method call appearing first. |