title: How to mock the linq expression in c#
body: <p>I am writing the unit test of linq expression using moq</p>
  
  <p>my linq expression getting employee list based on condition like employeeid and active record. </p>
  
  <p>This is my linq expression</p>
  
  <pre><code>employeess.Get(x =&gt; x.EmployeeId == employeeId &amp;&amp; x.Active == 1).FirstOrDefault();
  </code></pre>
  
  <p>i have set up the below generic expression to mock the employee list.  </p>
  
  <pre><code>mockrepo.Setup(x =&gt; 
    x.Get(
      It.IsAny&lt;Expression&lt;Func&lt;Employee, bool&gt;&gt;&gt;(), 
      It.IsAny&lt;Func&lt;IQueryable&lt;Employee&gt;, 
      IOrderedQueryable&lt;Employee&gt;&gt;&gt;(), 
      It.IsAny&lt;string&gt;()
      )
  ).Returns(employeeList.AsQueryable());
  </code></pre>
  
  <p>i want to write unit test to get the employeelist based on condition. how to mock the linq expression with condition</p>