Class RaisesException
Exception thrown when code unexpectedly fails to raise an event.
Namespace: Xunit.Sdk
Assembly: xunit.assert.dll
Syntax
public class RaisesException : XunitException
Constructors
| Improve this Doc View SourceRaisesException(Type)
Creates a new instance of the RaisesException class. Call this constructor when no event was raised.
Declaration
public RaisesException(Type expected)
Parameters
Type | Name | Description |
---|---|---|
Type | expected | The type of the event args that was expected |
RaisesException(Type, Type)
Creates a new instance of the RaisesException class. Call this constructor when an
Declaration
public RaisesException(Type expected, Type actual)
Parameters
Type | Name | Description |
---|---|---|
Type | expected | |
Type | actual |
Properties
| Improve this Doc View SourceActual
Gets the actual value.
Declaration
public string Actual { get; }
Property Value
Type | Description |
---|---|
String |
Expected
Gets the expected value.
Declaration
public string Expected { get; }
Property Value
Type | Description |
---|---|
String |
Message
Gets a message that describes the current exception. Includes the expected and actual values.
Declaration
public override string Message { get; }
Property Value
Type | Description |
---|---|
String | The error message that explains the reason for the exception, or an empty string(""). |
StackTrace
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. |