public void GivenMultipleRouteHandlersAreBeingAddedOnTheCatchAllRoute_ThenAnExceptionShouldBeThrown() { var configuration = new HttpServerConfiguration(); configuration.RegisterRoute(new EchoRouteHandler()); Assert.ThrowsException <Exception>(() => configuration.RegisterRoute(new EchoRouteHandler())); }
public FluentHttpServerTests ListeningOnDefaultRoute() { var routeHandler = new EchoRouteHandler(); _routeHandlers[string.Empty] = routeHandler; _configuration.RegisterRoute(routeHandler); _httpServer = new HttpServer(_configuration); return(this); }
public void GivenMultipleRouteHandlersAreBeingAddedWithTheSamePrefix_ThenAnExceptionShouldBeThrown() { var configuration = new HttpServerConfiguration() .RegisterRoute("api", new EchoRouteHandler()); Assert.ThrowsException <Exception>(() => configuration.RegisterRoute("api", new EchoRouteHandler())); }