Exemplo n.º 1
0
        public void GivenMultipleRouteHandlersAreBeingAddedOnTheCatchAllRoute_ThenAnExceptionShouldBeThrown()
        {
            var configuration = new HttpServerConfiguration();

            configuration.RegisterRoute(new EchoRouteHandler());

            Assert.ThrowsException <Exception>(() => configuration.RegisterRoute(new EchoRouteHandler()));
        }
Exemplo n.º 2
0
        public FluentHttpServerTests ListeningOnDefaultRoute()
        {
            var routeHandler = new EchoRouteHandler();

            _routeHandlers[string.Empty] = routeHandler;
            _configuration.RegisterRoute(routeHandler);
            _httpServer = new HttpServer(_configuration);
            return(this);
        }
Exemplo n.º 3
0
        public void GivenMultipleRouteHandlersAreBeingAddedWithTheSamePrefix_ThenAnExceptionShouldBeThrown()
        {
            var configuration = new HttpServerConfiguration()
                                .RegisterRoute("api", new EchoRouteHandler());

            Assert.ThrowsException <Exception>(() => configuration.RegisterRoute("api", new EchoRouteHandler()));
        }