In owin, its possible to test a web api in unit test using a TestServer (see this blog).
Is this functionality available for asp.net 5 middleware ?
UPDATE:
based on responses below, I tried to use TestServer, but visual studio complains that 'The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you .....'
I use Visual Studio 2015
in my nuget sources (settings) I have (https://www.myget.org/F/aspnetmaster/) (I also tried with https://www.myget.org/F/aspnetvnext/, but got the same problem)
here is my project.json file
{ "version": "1.0.0-*", "dependencies": { "Microsoft.AspNet.Http": "1.0.0-*", "Microsoft.AspNet.TestHost": "1.0.0-*", "Microsoft.AspNet.Hosting": "1.0.0-*", "Microsoft.AspNet.Testing" : "1.0.0-*", "xunit": "2.1.0-beta1-*", "xunit.runner.aspnet": "2.1.0-beta1-*", "Moq": "4.2.1312.1622", "Shouldly": "2.4.0" }, "commands": { "test": "xunit.runner.aspnet" }, "frameworks" : { "aspnet50" : { "dependencies": { } } } }