title: How to create dbContext fake for unit testing repository methods
body: <p>I have a method in Entity Framework concrete repository. It uses a Linq query that looks like this:</p>
  
  <pre><code>Table myTable = dbContext.Table.SingleOrDefault(t=&gt;
                  t.attribute1 == attribute1Value
                  &amp;&amp;
                  t.attribute2 == attribute2Value);
  </code></pre>
  
  <p>In my unit tests I tried to Shim dbContext. I want to use something like:</p>
  
  <pre><code>using (ShimsContext.Create())
  {
      // Don't know what to use here.
  }
  </code></pre>
  
  <p>I am struggling with the syntax here. Also if there is a way to get the dbContext stub instead of shimming it, please do let me know the correct approach.</p>