Skip to content

ExceptionExtensions.HaveParamName Method ​

Definition ​

Asserts that the ArgumentException has the specified parameter name.

c#
public static AssertionsChain<ExceptionAssertions<TException>, TException> HaveParamName<TException>(this ExceptionAssertions<TException> assertions, string expected)
   where TException : ArgumentException;

View source

Type Parameters ​

NameDescription
TExceptionThe type of the exception.

Parameters ​

NameTypeDescription
assertionsExceptionAssertions<TException>The assertions object.
expectedStringThe expected parameter name.

Returns ​

AssertionsChain<ExceptionAssertions<TException>, TException>

An AssertionsChain<TAssertions, T> for chaining further assertions.