<PackageReference Include="NUnit" Version="4.5.0" />

NUnit.Framework.Constraints.StringConstraint

public abstract class StringConstraint : Constraint
StringConstraint is the abstract base for constraints that operate on strings. It supports the IgnoreCase modifier for string operations.
protected bool caseInsensitive

Indicates whether tests should be case-insensitive

protected string descriptionText

Description of this constraint

protected readonly string expected

The expected value

public virtual StringConstraint IgnoreCase { get; }

Modify the constraint to ignore case in matching.

protected StringConstraint()

Constructs a StringConstraint without an expected value

protected StringConstraint(string expected)

Constructs a StringConstraint given an expected value

protected abstract bool Matches(string actual)

Test whether the constraint is satisfied by a given string

protected virtual bool Matches(string actual, StringComparison stringComparison)

Test whether the constraint is satisfied by a given string with a specific string comparison

protected virtual bool Matches(string actual, CultureInfo cultureInfo)

Test whether the constraint is satisfied by a given string with a specific culture

public virtual StringConstraint Using(StringComparison comparisonType)

Modify the constraint to use the specified comparison.

public virtual StringConstraint Using(CultureInfo culture)

Modify the constraint to use the specified culture info.