Skip to content

AsyncActionAssertions.ThrowArgumentExceptionAsync Method ​

Definition ​

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

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

Parameters ​

NameTypeDescription
expectedMessageStringThe expected exception message.
expectedParamNameStringThe expected parameter name.

Returns ​

Task<ActionAssertionsChain<ArgumentException>>

A Task<TResult> that resolves to an ActionAssertionsChain<TException> containing the thrown exception.