Skip to content

StringAssertions.NotContain Method ​

Definition ​

Asserts that the string does not contain the specified substring.

c#
public new AssertionsChain<StringAssertions, string> NotContain(string expected, StringComparison comparison = StringComparison.System.StringComparison);

View source

Parameters ​

NameTypeDescription
expectedStringThe substring that should not be present.
comparisonStringComparisonThe StringComparison to use. Defaults to Ordinal.

Returns ​

AssertionsChain<StringAssertions, String>

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