title: Using Moq To Test An Abstract Class
body: <p>I am trying to run a unit test on a method in an abstract class.  I have condensed the code below:</p>
  
  <p>Abstract Class:</p>
  
  <pre><code>public abstract class TestAb
  {
      public void Print()
      {
          Console.WriteLine("method has been called");
      }
  }
  </code></pre>
  
  <p>Test:</p>
  
  <pre><code>[Test]
  void Test()
  {
      var mock = new Mock&lt;TestAb&gt;();
      mock.CallBase = true;
      var ta = mock.Object;
      ta.Print();
      mock.Verify(m =&gt; m.Print());
  }
  </code></pre>
  
  <p>Message:</p>
  
  <pre><code>Method is not public
  </code></pre>
  
  <p>What am I doing wrong here?  My goal is to test the methods inside the abstract class using he Moq framework.</p>