Skip to content

ExceptionAssertions<T>.NotHaveMessageStartingWith Method

Definition

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

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

Parameters

Name Type Description
expected String The message prefix that is not expected.
comparison StringComparison The StringComparison to use. Defaults to InvariantCulture.

Returns

ExceptionAssertionsChain<T>

An ExceptionAssertionsChain<T> for chaining further assertions.