title: How can I create and populate my mock classes with Autofixture?
body: <p>Currently I'm using EF6 to implement my repositories inside a UnitOfWork.  I also have created an In-Memory mock implementations (MockUnitOfWork &amp; MockRepository) so that I can use them in unit tests, however I now have to deal with the tedious setup of the objects.   </p>
  
  <p>Isn't this what Autofixture is designed to do?  How would I go about getting a MockUnitOfWork that I can use in my tests that contains <strong>Foo</strong> and <strong>Barr</strong> repositories that are populated?  I'm using NSubstitute for my mocking framework.</p>
  
  <p>IUnitOfWork</p>
  
  <pre><code>public interface IUnitOfWork
  {
      void Save();
      void Commit();
      void Rollback();
  
      IRepository&lt;Foo&gt; FooRepository { get; }
      IRepository&lt;Bar&gt; BarRepository { get; }
  }
  </code></pre>
  
  <p>IRepository</p>
  
  <pre><code>public interface IRepository&lt;TEntity&gt; where TEntity : class
  {
      Func&lt;IQueryable&lt;TEntity&gt;, IOrderedQueryable&lt;TEntity&gt;&gt; orderBy = null, string         includeProperties = "");
  
      IEnumerable&lt;TEntity&gt; Get(Expression&lt;Func&lt;TEntity, bool&gt;&gt; filter = null, Func&lt;IQueryable&lt;TEntity&gt;, IOrderedQueryable&lt;TEntity&gt;&gt; orderBy = null);
      TEntity GetByID(object id);
  
      void Insert(TEntity entity);
      void Delete(object id);
      void Delete(TEntity entityToDelete);
      void Update(TEntity entityToUpdate);
  }
  </code></pre>