title: Unit Test to verify content of IEnumerable<dynamic>
body: <p>Given the following WebAPI method:</p>
  
  <pre><code>public IHttpActionResult GetDeliveryTypes()
  {
      return Ok(... .Select(dt =&gt; new { Id = dt.Id, Name = dt.Name }));
  }
  </code></pre>
  
  <p>Where  </p>
  
  <pre><code>typeof(Id) = long  
  typeof(Name) = string
  </code></pre>
  
  <p>While unit testing, how can I</p>
  
  <ol>
  <li><p>Assert that the content is as I expect it? For example, the following assertion fails  </p>
  
  <pre><code>var contentResult = response as OkNegotiatedContentResult&lt;IEnumerable&lt;dynamic&gt;&gt;;
  Assert.IsNotNull(contentResult);
  </code></pre></li>
  <li><p>Reduce this <code>IEnumerable&lt;dynamic&gt;</code> result to an <code>IEnumerable&lt;long&gt;</code> so I can verify that it contains the expected sequence of values?</p></li>
  </ol>
  
  <p>I have already added the <code>InternalsVisibleTo</code> attribute to the AssemblyInfo.</p>