title: Moq: Invalid setup on a non-overridable member: x => x.GetByTitle("asdf")
body: <p>Not sure how I can fix this, trying to do a unit test on the method "GetByTitle"</p>
  
  <p>Here are my definitions:</p>
  
  <pre><code>public class ArticleDAO :  GenericNHibernateDAO(IArticle, int&gt;, IArticleDAO
  {
      public IArticle GetByTitle(string title)
      {
          IQuery query = Session.CreateQuery("...")
          return query.UniqueResult&lt;IArticle&gt;();
      }
  }
  
  public interface IArticleDAO
  {
      IArticle GetByTitle(string title);
  }
  </code></pre>
  
  <p>unit test:</p>
  
  <pre><code>[Test]
  public void can_load_by_title()
  {
      _mockDaoFactory.Setup(x =&gt; x.GetArticleDao())
                                  .Returns(_mockArticleDao.Object);
      _mockArticleDao.Setup(x =&gt; x.GetByTitle("some title"))
                                  .Returns(article1.Object);
  
      _articleManager.LoadArticle("some title");
  
      Assert.IsNotNull(_articleManager.Article);
  }
  </code></pre>
  
  <p>Running the test gives me the error:</p>
  
  <pre><code>System.ArgumentException: Invalid setup on a non-overridable member:
  x =&gt; x.GetByTitle("some title")
  </code></pre>
  
  <p><b>Update</b></p>
  
  <p>My <code>[Setup]</code> looks like:</p>
  
  <pre><code>[Setup]
  public void SetUp()
  {
       _mockDaoFactory = new Mock&lt;IDaoFactory&gt;();
       _mockArticleDao = new Mock&lt;ArticleDao&gt;();
  
       _articleManager = new ArticleManager(_mockDaoFactory.Object);    
  }
  </code></pre>