title: Returning different results or throwing exceptions from successive calls to Moq Mock
body: <p>I get a Moq object to return different values on successive calls to a method. This is done by this extension method: </p>
  
  <pre><code>public static void ReturnsInOrder&lt;T, TResult&gt;(this ISetup&lt;T, TResult&gt; setup, params TResult[] results) where T : class
  {
      setup.Returns(new Queue&lt;TResult&gt;(results).Dequeue);
  }
  </code></pre>
  
  <p>Now I want one of the calls to throw an exception while others return something. Has anyone done this before?</p>
  
  <p>If i do this</p>
  
  <pre><code>mock.Setup(m =&gt; m.SomeMethod())
      .Throws(new Exception());
  mock.Setup(m =&gt; m.SomeMethod())
      .Returns("ok");
  </code></pre>
  
  <p>then the the first setup is overwritten and only the second setup persists.</p>