Skip to content

ActionAssertions.ThrowArgumentException Method ​

Definition ​

Asserts that the action throws an ArgumentException with the specified message and parameter name.

c#
public ActionAssertionsChain<ArgumentException> ThrowArgumentException(string expectedMessage, string expectedParamName);

View source

Parameters ​

NameTypeDescription
expectedMessageStringThe expected exception message.
expectedParamNameStringThe expected parameter name.

Returns ​

ActionAssertionsChain<ArgumentException>

An ActionAssertionsChain<TException> containing the thrown exception.