Skip to content

ExceptionAssertions<T>.HaveMessage Method

Definition

Asserts that the exception has the specified message.

public ExceptionAssertionsChain<T> HaveMessage(string expected, StringComparison comparison = StringComparison.System.StringComparison);

Parameters

Name Type Description
expected String The expected message.
comparison StringComparison The StringComparison to use. Defaults to InvariantCulture.

Returns

ExceptionAssertionsChain<T>

An ExceptionAssertionsChain<T> for chaining further assertions.