Beispiel #1
0
        public void GivenMultipleRouteHandlersAreBeingAddedOnTheCatchAllRoute_ThenAnExceptionShouldBeThrown()
        {
            var configuration = new HttpServerConfiguration();

            configuration.RegisterRoute(new EchoRouteHandler());

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

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

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