Skip to content

ExceptionAssertions<T>.HaveInnerException Method

Overloads

Name Description
HaveInnerException<TException>() Asserts that the exception has an inner exception of the specified type.
HaveInnerException<TException>(TException) Asserts that the exception has the exact specified inner exception instance.

HaveInnerException<TException>()

Asserts that the exception has an inner exception of the specified type.

public InnerExceptionAssertionsChain<TException> HaveInnerException<TException>()
   where TException : Exception;

Type Parameters

Name Description
TException The expected inner exception type.

Returns

InnerExceptionAssertionsChain<TException>

An InnerExceptionAssertionsChain<TException> for asserting on the inner exception.

HaveInnerException<TException>(TException)

Asserts that the exception has the exact specified inner exception instance.

public InnerExceptionAssertionsChain<TException> HaveInnerException<TException>(TException expected)
   where TException : Exception;

Type Parameters

Name Description
TException The expected inner exception type.

Parameters

Name Type Description
expected TException The expected inner exception instance.

Returns

InnerExceptionAssertionsChain<TException>

An InnerExceptionAssertionsChain<TException> for asserting on the inner exception.