ASP.NET Web API integration testing with in-memory hosting

added by fdub
6/12/2012 1:12:31 PM


In-memory hosting is one of the hidden gems of ASP.NET Web API. Let me show you an example today, how a lightweight Web API server can be temporarily established in memory (without elevated priviliges, or cannibalizing ports like self host) and used to perform integration testing, allowing you to test almost the entire pipeline, from the request to the response.


6/13/2012 8:26:31 AM
That is really cool, and greatly simplifies automated testing. Your test environment no longer needs to be a duplicate of your staging environment.