title: Is unit testing the definition of an interface necessary?
body: <p>I have occasionally heard or read about people asserting their interfaces in a unit test. I don't mean mocking an interface for use in another type's test, but specifically creating a test to accompany the interface. </p>
  
  <p>Consider this ultra-lame and off-the-cuff example:</p>
  
  <pre><code>public interface IDoSomething
  {
     string DoSomething();
  }
  </code></pre>
  
  <p>and the test:</p>
  
  <pre><code>[TestFixture]
  public class IDoSomethingTests
  {
     [Test]
     public void DoSomething_Should_Return_Value()
     {
          var mock = new Mock&lt;IDoSomething&gt;();
          var actualValue = mock.Expect(m =&gt; m.DoSomething()).Returns("value");
  
          mock.Object.DoSomething();
          mock.Verify(m =&gt; DoSomething());
          Assert.AreEqual("value", actualValue);
     }
  }
  </code></pre>
  
  <p>I suppose the idea is to use the test to drive the design of the interface and also to provide guidance for implementors on what's expected so they can draw good tests of their own.</p>
  
  <p>Is this a common (recommended) practice?</p>