title: Verify the number of times a protected method is called using Moq
body: <p>In my unit-tests I'm mocking a protected method using Moq, and would like to assert that it is called a certain number of times. <a href="https://stackoverflow.com/questions/390632/verifying-protected-abstract-methods-are-called-using-moq">This question</a> describes something similar for an earlier version of Moq:</p>
  
  <pre><code>//expect that ChildMethod1() will be called once. (it's protected)
  testBaseMock.Protected().Expect("ChildMethod1")
    .AtMostOnce()
    .Verifiable();
  
  ...
  testBase.Verify();
  </code></pre>
  
  <p>but this no longer works; the syntax has changed since then and I cannot find the new equivalent using Moq 4.x:</p>
  
  <pre><code>testBaseMock.Protected().Setup("ChildMethod1")
    // no AtMostOnce() or related method anymore
    .Verifiable();
  
  ...
  testBase.Verify();
  </code></pre>