ExceptionAssertions<T>.HaveMessage Method
Definition
Asserts that the exception has the specified message.
c#
public AssertionsChain<ExceptionAssertions<T>, 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
AssertionsChain<ExceptionAssertions<T>, T>
An AssertionsChain<TAssertions, T> for chaining further assertions.