title: Assertions (contracts) and unit testing
body: <p>Say I have a method</p>
  
  <pre><code>public void PrintStuff(string stuff, Color color, PageDimensions dimensions)
  {
       Assert.IsNotNull("color");
       Assert.IsNotNull(dimensions);
       Assert.IsTrue(dimensions.width &lt; 20.0);
  }
  </code></pre>
  
  <p>and I have another method <code>AnotherMethod()</code> which is calling <code>PrintStuff()</code>. Let's assume <code>PrintStuff()</code> is defined in some interfaces that <code>AnotherMethod()</code> is using. The question is: when writing a unit test for <code>AnotherMethod()</code> how can I <strong>automate</strong> testing that <code>AnotherMethod()</code> does not pass any values into <code>PrintStuff()</code> that violate its assertions?</p>
  
  <p>Something like:</p>
  
  <pre><code>printer.Expect(x =&gt; x.PrintStuff(null, null, null)).CheckAssertions();
  </code></pre>
  
  <p>The solution should support a change in assertions automatically.</p>