title: Unit testing code using IQueryable
body: <p>I'm asked to write some unit tests for some functionality, but quite frankly I'm not so sure about the need or usefulness of doing so <strong>for this particular</strong> piece of code. <em>I'm in no way trying to question the need or usefulness of unit testing in general.</em></p>
  
  <p>The code in question is very trivial and gets used alot. Basically it's a wrapper around the .Skip() and .Take() extension methods. In my opinion the legitimacy of the methods as a whole is questionable.</p>
  
  <p>The code is basically this:</p>
  
  <pre><code>public IQueryable&lt;T&gt; Page(IQueryable&lt;T&gt; query, int page, int size)
  {
      if(query == null) throw new ArgumentNullException("query");
      if(page &lt; 0) throw new ArgumentOutOfRangeException("page"); 
      if(page &lt; 0) throw new ArgumentOutOfRangeException("size"); 
  
      return query.Skip(page * size).Take(size);
  }
  </code></pre>
  
  <p>Of course I can unit test for the expected exceptions, but what else? Could very well be that I'm missing the point, so what's up with this?</p>