title: how to generate fake data using moq for unit test?
body: <p>I need to generate some data to unit test my repositories. i was using a loop to generate a list of objects, see codes below.  I learned moq is a great mocking library, Can I use moq to generate that and how do I do it?</p>
  
  <pre><code>public IQueryable&lt;Category&gt; GetCategories()
  {
      IList&lt;Category&gt; result = new List&lt;Category&gt;();
  
      for (int i = 1; i &lt;= 2; i++)
      {
          Category c = new Category();
          c.ID = i;
          c.Name = "Parent" + i.ToString();
          c.ParentID = 0;
  
          for (int x = i*10; x &lt; i*10+5; x++)
          {
              Category sub = new Category();
              sub.ID = x;
              sub.Name = "Sub" + x.ToString();
              sub.ParentID = i;
              result.Add(sub);
          }
  
          result.Add(c);
      }
  
      return result.AsQueryable&lt;Category&gt;();
  }
  </code></pre>