title: Understanding unit test constraints and NUnit syntax helpers
body: <p>Me and a colleague are starting a new project and attempting to take full advantage of TDD. We're still figuring out all the concepts around unit testing and are thus far basing them primarily on other examples. </p>
  
  <p>My colleague recently brought into question the point of the NUnit syntax helpers and I'm struggling to explain their benefit (since I don't really understand it myself other than my gut says they're good!). Here is an example assertion:</p>
  
  <pre><code>Assert.That(product.IsValid(), Is.False);
  </code></pre>
  
  <p>To me this makes complete sense, we're saying we expect the value of <code>product.IsValid()</code> to be <code>false</code>. My colleague on the other hand would prefer us to simply write:</p>
  
  <pre><code>Assert.That(!product.IsValid());
  </code></pre>
  
  <p>He says to him this makes more sense and he can read it easier.</p>
  
  <p>So far the only thing we can agree on is that you are likely to get more helpful output when the test is failing from the former, but I think there must be a better explanation. I've looked up some information on the syntax helpers (<a href="http://nunit.com/blogs/?p=44" rel="nofollow noreferrer">http://nunit.com/blogs/?p=44</a>) and they make sense, but I don't fully understand the concept of constraints other than they 'feel' right.</p>
  
  <p>I wonder if someone could explain why we use the concept of constraints, and why they improve the unit test examples above?</p>
  
  <p>Thanks.</p>