title: How to make a FakeItEasy faked object's method throw on first invocation and return on second?
body: <p>I have a method which is invoked multiple times within a <code>foreach</code> loop, each time with the same parameter values.</p>
  
  <pre><code>foreach (var item in myCollection)
  {
      // do some stuff with item
      // then...
      var result = _myService.Foo(aConstant, anotherConstant);
      // do something with result
  }
  </code></pre>
  
  <p>I am trying to write a test that ensures the loop continues iterating even if <code>_myService.Foo()</code> throws an exception on the first time through.</p>
  
  <p>In <a href="http://code.google.com/p/moq/" rel="nofollow">Moq</a>, I am allowed to chain together calls to <code>Returns</code> and <code>Throws</code> like so:</p>
  
  <pre><code>mockService.Setup(x =&gt; x.Foo(aConstant, anotherConstant)).Throws&lt;Exception&gt;().Returns(someResult);
  </code></pre>
  
  <p>This will cause the call to <code>Foo</code> to throw an Exception but all subsequent calls will return <code>someResult</code>. My main goal is to ensure that a try/catch block is wrapped around the second half of code inside my foreach block so that the loop continues even if an Exception occurs.</p>
  
  <pre><code>foreach (var item in myCollection)
  {
      // do some stuff with item
      // then...
      try
      {
          var result = _myService.Foo(aConstant, anotherConstant);
          // do something with result
      }
      catch (Exception e)
      {
          // ignore any exceptions here and continue looping
      }
  }
  </code></pre>
  
  <p>How can I accomplish something similar to this in <a href="https://github.com/FakeItEasy/FakeItEasy" rel="nofollow">FakeItEasy</a>?  Or is there a different (better) strategy I could use for doing this kind of assertion?</p>