title: How to unit test repository method
body: <p>I have this method to unit test:</p>
  
  <pre><code>public virtual TEntity Get(int id)
          {
              return _db.Set&lt;TEntity&gt;().Find(id);
          }
  </code></pre>
  
  <p>Could someone please tell me how to unit test this?</p>
  
  <p>I'm thinking what I need to test is that Find is called with the correct id?</p>
  
  <p>First I was trying to mock the context <code>_db</code> using Moq. Set isn't virtual though so can't use <code>Verify</code>.</p>
  
  <p>Could someone please suggest an alternative method of testing this?</p>