You can use Self Hosting to run controllers and use the function OpenAsync().ContinueWith(t => { /* ... */ })to run your tests. You want to override Configuration.DependencyResolverand override IHttpControllerActivatorso that you can specify your own layout implementation (for example, you can use Ninject to get a specific controller that is already associated with the layout implementation).