title: Verifying a method was called
body: <p>Using Moq, I have a very odd issue where the setup on a mock only seems to work if the method I am setting up is public.  I don't know if this is a Moq bug or if I just have this wrong (newbie to Moq). Here is the test case:</p>
  
  <pre><code>public class TestClass
  {
      public string Say()
      {
          return Hello();
      }
  
      internal virtual string Hello()
      {
          return "";
      }
  }
  
  [TestMethod]
  public void Say_WhenPublic_CallsHello()
  {
      Mock&lt;TestClass&gt; mock = new Mock&lt;TestClass&gt;();
      mock.Setup(x =&gt; x.Hello()).Returns("Hello World");
  
      string result = mock.Object.Say();
      mock.Verify(x =&gt; x.Hello(), Times.Exactly(1));
      Assert.AreEqual("Hello World", result);     
  }
  </code></pre>
  
  <p>Which fails with this message:</p>
  
  <blockquote>
    <p>Say_WhenPublic_CallsHello failed: Moq.MockException: 
    Invocation was not performed on the mock 1 times: x => x.Hello()
    at Moq.Mock.ThrowVerifyException(IProxyCall expected, Expression expression, Times times)...</p>
  </blockquote>
  
  <p>If I make the Hello method public like this, the test passes.  What is the issue here?</p>
  
  <pre><code>public virtual string Hello()
  {
      return "";
  }
  </code></pre>
  
  <p>Thanks in advance!</p>