コード例 #1
0
        public void GivenMultipleRouteHandlersAreBeingAddedOnTheCatchAllRoute_ThenAnExceptionShouldBeThrown()
        {
            var configuration = new HttpServerConfiguration();

            configuration.RegisterRoute(new EchoRouteHandler());

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

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

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