title: Verifying a delegate was called with Moq
body: <p>i got a class that gets by argument a delegate.
  This class invokes that delegate, and i want to unit test it with Moq.
  how do i verify that this method was called ?</p>
  
  <p>example class :</p>
  
  <pre><code>public delegate void Foo(int number);
  
  public class A
  {
     int a = 5;
  
     public A(Foo myFoo)
     {
        myFoo(a);
     }
  }
  </code></pre>
  
  <p>and I want to check that Foo was called.
  Thank you.</p>