private static void ResumeTheRouteInHalfASecond(RouteConfigurer route) { new Thread(() => { Thread.Sleep(500); route.Resume(); }).Start(); }
private void MakeVerbRequest(RouteConfigurer configurer, Method verb) { if (verb == Method.HEAD) { configurer.Responds(""); MakeRequest("/test", verb).StatusCode.ShouldBe(HttpStatusCode.OK); return; } configurer.Responds(verb + "output"); MakeRequest("/test", verb).Content.ShouldBe(verb + "output"); }
public void SetUp() { var method = ReflectionHelper.GetMethod<TestController>(c => c.SomeAction(null)); _config = new ControllerActionConfig(method, null, null); method = ReflectionHelper.GetMethod<TestController>(c => c.AnotherAction(null)); _otherConfig = new ControllerActionConfig(method, null, null); _config.PrimaryUrl = "test/someaction"; _otherConfig.PrimaryUrl = "test/anotheraction"; _conventions = new FubuConventions(); _fubuConfig = new FubuConfiguration(_conventions); _fubuConfig.AddControllerActionConfig(_config); _fubuConfig.AddControllerActionConfig(_otherConfig); _registry = new RouteConfigurer(_fubuConfig, _conventions); _registry.Configure(); }
public void should_override_app_default_if_specified() { var method = ReflectionHelper.GetMethod<TestController>(c => c.SomeAction(null)); _config = new ControllerActionConfig(method, null, null); _conventions.IsAppDefaultUrl = config => true; _fubuConfig = new FubuConfiguration(_conventions); _fubuConfig.AddControllerActionConfig(_config); _registry = new RouteConfigurer(_fubuConfig, _conventions); _registry.Configure(); ((ActionRouteHandler)_registry.AppDefaultRoute.RouteHandler).Config.ShouldBeTheSameAs(_config); }
public void the_first_action_should_be_the_system_default() { var method = ReflectionHelper.GetMethod<TestController>(c => c.SomeAction(null)); _config = new ControllerActionConfig(method, null, null); _fubuConfig = new FubuConfiguration(_conventions); _fubuConfig.AddControllerActionConfig(_config); _registry = new RouteConfigurer(_fubuConfig, _conventions); _registry.Configure(); ((ActionRouteHandler)_registry.AppDefaultRoute.RouteHandler).Config.ShouldBeTheSameAs(_config); }