title: Reset mock verification in Moq?
body: <p>Setup as so:</p>
  
  <pre><code>public interface IFoo
  {
      void Fizz();
  }
  
  [Test]
  public void A()
  {
      var foo = new Mock&lt;IFoo&gt;(MockBehavior.Loose);
  
      foo.Object.Fizz();
  
      foo.Verify(x =&gt; x.Fizz());
  
      // stuff here
  
      foo.Verify(x =&gt; x.Fizz(), Times.Never()); // currently this fails
  }
  </code></pre>
  
  <p>Basically I'd like to enter some code at the <code>// stuff here</code> to make the <code>foo.Verify(x =&gt; x.Fizz(), Times.Never())</code> pass.</p>
  
  <p>And because this probably constitutes moq/unit testing abuse, my justification is so I can do something like this:</p>
  
  <pre><code>[Test]
  public void Justification()
  {
      var foo = new Mock&lt;IFoo&gt;(MockBehavior.Loose);
      foo.Setup(x =&gt; x.Fizz());
  
      var objectUnderTest = new ObjectUnderTest(foo.Object);
  
      objectUnderTest.DoStuffToPushIntoState1(); // this is various lines of code and setup
  
      foo.Verify(x =&gt; x.Fizz());
  
      // reset the verification here
  
      objectUnderTest.DoStuffToPushIntoState2(); // more lines of code
  
      foo.Verify(x =&gt; x.Fizz(), Times.Never());
  }
  </code></pre>
  
  <p>Basically, I have a state object where a fair bit of work (both in terms of making various mock objects and other faffing around) is requires to push it into State1. Then I want to test the transition from State1 to State2. Instead of duplicating or abstracting the code I'd prefer to just re-use the State1 test, push it into State2 and perform my Asserts - all of which I can do except the verification calls.</p>