Skip to content

ExceptionAssertions<T>.NotHaveMessageStartingWith Method ​

Definition ​

Asserts that the exception message does not start with the specified string.

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

View source

Parameters ​

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

Returns ​

AssertionsChain<ExceptionAssertions<T>, T>

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