I’ve been working with ASP.Net WebAPI a bit lately. While doing this, I had the need for writing some integration tests by excercising the API using my little Requester library. I wanted a solution where I was doing requests against “hosted” API-endpoints, where the OWIN pipeline for the API has been executed and my Ninject container bootstraped, my filters for FluentValidation working… you get the picture right. To get this behaviour, I could have gone with in-process self-hosting, but found that the in-memory OWIN pipline cabable hosting solution to be a really nice fit (docs | NuGet). And after a tiny adjustment of Requester, it worked against it as well.
Time for a small recipe of what I needed to do, to get a SQL-Server Express 2014 instance, running on Windows 2012R2, accessible from a remote machine.
Wouldn’t it be awesome if Microsoft and JetBrains could come to an agreement, so that EVERYTHING needed to build an Asp.Net solution, could be resolved from within TeamCity so that we wouldn’t have to make separate installs of msbuild tools and .Net frameworks and, most ANNOYINGLY, the web application targets that so many applies the “manual copy workaround” for.