title: Unable to cast object of type 'System.Linq.EnumerableQuery to type 'Microsoft.Azure.Documents.Linq.IDocumentQuery
body: <p>I have a class with the following Method and am using Moq as a Unit Testing Framework. How can I mock the following:</p>
  
  <pre><code>FeedOptions feedOptions = new FeedOptions
          {
              MaxItemCount = 1000
          };
  
          var query = await _storeAccessClient.CreateDocumentQueryAsync&lt;CustomEntity&gt;(_collectionLink, feedOptions)
              .Where(c =&gt; c.DataType == _dataType)
              .OrderBy(c =&gt; c.StartTime, sortOrder)
              .AsDocumentQuery()
          .ExecuteNextAsync&lt;CustomEntity&gt;();
  
          List&lt;CustomEntity&gt; result = query.ToList&lt;CustomEntity&gt;();
  </code></pre>
  
  <p>Any Help is greatly Appreciated !!</p>