Ejemplo n.º 1
0
 private static void ResumeTheRouteInHalfASecond(RouteConfigurer route)
 {
     new Thread(() =>
     {
         Thread.Sleep(500);
         route.Resume();
     }).Start();
 }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }