Skip to content

ExceptionAssertions<T>.HaveInnerException Method ​

Overloads ​

NameDescription
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.

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

View source

Type Parameters ​

NameDescription
TExceptionThe 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.

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

View source

Type Parameters ​

NameDescription
TExceptionThe expected inner exception type.

Parameters ​

NameTypeDescription
expectedTExceptionThe expected inner exception instance.

Returns ​

InnerExceptionAssertionsChain<TException>

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