Class StartsWithConstraint
StartsWithConstraint can test whether a string starts with an expected substring.
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class StartsWithConstraint : StringConstraint, IConstraint, IResolveConstraint
Constructors
View SourceStartsWithConstraint(string)
Initializes a new instance of the StartsWithConstraint class.
Declaration
public StartsWithConstraint(string expected)
Parameters
Type | Name | Description |
---|---|---|
string | expected | The expected string |
Methods
View SourceMatches(string?)
Test whether the constraint is matched by the actual value. This is a template method, which calls the IsMatch method of the derived class.
Declaration
protected override bool Matches(string? actual)
Parameters
Type | Name | Description |
---|---|---|
string | actual |
Returns
Type | Description |
---|---|
bool |