title: IQueryable Unit or Integration Test
body: <p>I have a web api and I am exposing a endpoint like so:</p>
  
  <blockquote>
    <p>api/Holiday?name={name}</p>
  </blockquote>
  
  <p>This is the controller get method for the web api:</p>
  
  <pre><code>public IQueryable&lt;Holiday&gt; GetHolidayByName(string name)
  {
      return db.Holiday.Where(n =&gt; string.Equals(n.Name, name));
  }
  </code></pre>
  
  <p>How can I write a unit/integration test for this that checks the names are equal? I can check the result is not null however bit confused how I can check the names are equal:</p>
  
  <pre><code>[TestMethod]
  public void GetHoliday_GetHolidayByName()
  {
      // Arrange
      HolidaysController controller = new HolidaysController();
  
      // Act
      IQueryable&lt;Holiday&gt; actionResult = controller.GetHolidayByName("Spain");
  
      //Assert
      Assert.IsNotNull(actionResult);
  
      //any attempt to check names are equal results in a fail
      //For instance this fails
      var result = controller.GetHolidayByName("Spain") as OkNegotiatedContentResult&lt;Holiday&gt;;
      Assert.AreEqual("Spain", result.Content.Name);        
  }
  </code></pre>