title: How to Mock IMongoCollection.Find using Moq
body: <p>I am struggling in mocking <code>IMongoCollection.Find</code> method using Moq for my unit tests.</p>
  
  <p>What I tried:</p>
  
  <pre><code>  Mock&lt;IMongoCollection&lt;Person&gt;&gt; mockIMongoCollection = new Mock&lt;IMongoCollection&lt;Person&gt;&gt;();
    mockIMongoCollection.SetupAllProperties();
    mockIMongoCollection
              .Setup(x =&gt; x.Find(
                  It.IsAny&lt;FilterDefinition&lt;Person&gt;&gt;(),
                  It.IsAny&lt;FindOptions&gt;()))
              .Returns();
  </code></pre>
  
  <p>The thing is whatever I try to return using <code>Returns()</code>, it is not working, I expect to be able to return something convertible to <code>List&lt;Person&gt;</code> and I can't mock or create an instance of <code>IFindFluent&lt;Person,Person&gt;</code> as suggested by return type of <code>Find</code> method.</p>