Given the following WebAPI method
public IHttpActionResult GetDeliveryTypes()
{
return Ok(... .Select(dt => new { Id = dt.Id, Name = dt.Name }));
}
Where
typeof(Id) = long
typeof(Name) = string
In a unit test, how can I
-
Assert that the content is as I expect it? For example, the following assertion fails
var contentResult = response as OkNegotiatedContentResult<IEnumerable<dynamic>>; Assert.IsNotNull(contentResult); -
Reduce this
IEnumerable<dynamic>result to anIEnumerable<long>so I can verify that it contains the expected sequence of values?
I have already added the InternalsVisibleTo attribute to the AssemblyInfo.
Aucun commentaire:
Enregistrer un commentaire