title: The "intent" behind unit tests - what should I be aiming for?
body: <p>I wrote a series of tests today around a method that takes an input value and returns a different array of data depending whether the value passes some (internal) validation test, i.e.</p>
  
  <pre><code>[TestMethod] 
  public void IsValidForValueFour()
  {
      var result = myComponent.Validator(4);
      Assert.IsTrue(result[0], "Blah");
  }
  </code></pre>
  
  <p>The <code>Validator()</code> method basically does a lookup in a  (hardcoded) table stored privately in <code>myComponent</code>. </p>
  
  <p>This <em>felt</em> wrong. I was effectively testing the values in a private lookup table. Should I care about the values passed in and out? Should I be testing the length of the output array rather than its contents? Or is it right to test for specific responses given some input value?  </p>
  
  <p>In short, what should the <em>intent</em> be behind a unit test like this?</p>