ExceptionAssertions<T>.HaveMessageStartingWith Method
Definition
Asserts that the exception message starts with the specified string.
c#
public AssertionsChain<ExceptionAssertions<T>, T> HaveMessageStartingWith(string expected, StringComparison comparison = StringComparison.System.StringComparison);Parameters
| Name | Type | Description |
|---|---|---|
expected | String | The expected message prefix. |
comparison | StringComparison | The StringComparison to use. Defaults to InvariantCulture. |
Returns
AssertionsChain<ExceptionAssertions<T>, T>
An AssertionsChain<TAssertions, T> for chaining further assertions.