public async Task SendBasicRequest_RespondsAsExpected()
        {
            using (var host = new HttpApplicationHost("123", 9032))
            {
                host.AddComponent(c =>
                {
                    var writer = c.Response.CreateTextResponse();

                    writer.Write("hi");

                    return Task.FromResult(0);
                }, OwinPipelineStage.PreHandlerExecute);

                host.Start();

                var text = await InvokeUrl(new Uri("http://localhost:9032/"));

                Assert.That(text, Is.EqualTo("hi"));
            }
        }
        public async Task Send_UsingRoutingHandler()
        {
            using (var host = new HttpApplicationHost("123", 9032))
            {
                var routingHandler = new RoutingHandler();

                host.AddComponent(routingHandler.CreateApplicationDelegate());

                routingHandler.AddRoute(new UriRoute(new Uri(Uri.UriSchemeHttp + Uri.SchemeDelimiter + "localhost:9032"), "/route/{param1}"), c =>
                {
                    c.Response.CreateTextResponse().Write("Hi " + c["route.param1"]);

                    return Task.FromResult(0);
                });

                host.Start();

                var text = await InvokeUrl(new Uri("http://localhost:9032/route/123"));

                Assert.That(text, Is.EqualTo("Hi 123"));
            }
        }