Table of Contents

Class SubstringConstraint

Namespace
NUnit.Framework.Constraints
Assembly
nunit.framework.dll

SubstringConstraint can test whether a string contains the expected substring.

public class SubstringConstraint : StringConstraint, IConstraint, IResolveConstraint
Inheritance
SubstringConstraint
Implements
Inherited Members

Constructors

SubstringConstraint(string)

Initializes a new instance of the SubstringConstraint class.

public SubstringConstraint(string expected)

Parameters

expected string

The expected.

Methods

Matches(string)

Test whether the constraint is satisfied by a given value

protected override bool Matches(string actual)

Parameters

actual string

The value to be tested

Returns

bool

True for success, false for failure