Skip to content

StartsWithConstraint

Charlie Poole edited this page Jan 31, 2016 · 6 revisions

StartsWithConstraint tests for an initial string.

Constructor

```C# StartsWithConstraint(string expected) ```

Syntax

```C# Does.StartWith(string expected) StartsWith(string expected) ```

Modifiers

```C# ...IgnoreCase ```

Examples of Use

```C# string phrase = "Make your tests fail before passing!"

Assert.That( phrase, Does.StartWith( "Make" ) ); Assert.That( phrase, Does.Not.StartWith( "Break" ) ); Expect( phrase, StartsWith( "Make" ) );


<h4>Notes</h4>

1. **StartsWith** may appear only in the body of a constraint 
   expression or when the inherited syntax is used.


Clone this wiki locally