Table of Contents

Class RaisesException

Namespace
Xunit.Sdk
Assembly
xunit.v3.assert.dll

Exception thrown when Assert.Raises fails.

public class RaisesException : XunitException, ISerializable, IAssertionException
Inheritance
RaisesException
Implements
Inherited Members

Methods

ForIncorrectType(Type, Type)

Creates a new instance of the RaisesException class to be thrown when the raised event wasn't the expected type.

public static RaisesException ForIncorrectType(Type expected, Type actual)

Parameters

expected Type

The type of the event args that was expected

actual Type

The type of the event args that was actually raised

Returns

RaisesException

ForNoEvent()

Creates a new instance of the RaisesException class to be thrown when no event (without data) was raised.

public static RaisesException ForNoEvent()

Returns

RaisesException

ForNoEvent(Type)

Creates a new instance of the RaisesException class to be thrown when no event (with data) was raised.

public static RaisesException ForNoEvent(Type expected)

Parameters

expected Type

The type of the event args that was expected

Returns

RaisesException