title: Verify with xUnit and Moq if a method was executed base on a condition
body: <p>With xUnit and Moq check if a method is executed base on the return value of another method. Example:</p>
  
  <pre><code>public class A 
  {
      public bool M1() { // return true or false ... }
      public void M2() { // Do something ..... }
  }
  
  public class B 
  {
      private A objectA;
  
      public B(A a)
      {
          objectA = a;
      }
  
      public void Mb ()
      {
          for(int i = 0; i &lt;= 5; i++)
          {
              if (objectA.M1())
              {
                  return;
              }
  
              objectA.M2();
         }
      }
  }
  </code></pre>
  
  <p>I want to verify something like this:</p>
  
  <pre><code>[Fact]
  public void Test()
  {
      // Arrange
      Mock&lt;A&gt; mockA = new Mock&lt;A&gt;();
      mockA.Setup(x =&gt; x.M1()).Return(true);
      mockA.Setup(x =&gt; x.M2());
  
      // Act
      B b = new B(mockA.object);
      b.Mb();
  
      // Assert
      mockA.Verify(m =&gt; m.M2(), """all exactly time that M1 returned false"""); // if this were possible it would be perfect
  }
  </code></pre>
  
  <p>Is it possible to do something like that with xUnit and Moq ??</p>