Skip to content

ExceptionAssertions<T>.NotHaveMessage Method ​

Definition ​

Asserts that the exception does not have the specified message.

c#
public AssertionsChain<ExceptionAssertions<T>, T> NotHaveMessage(string expected, StringComparison comparison = StringComparison.System.StringComparison);

View source

Parameters ​

NameTypeDescription
expectedStringThe message that is not expected.
comparisonStringComparisonThe StringComparison to use. Defaults to InvariantCulture.

Returns ​

AssertionsChain<ExceptionAssertions<T>, T>

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