public void should_remember_added_behavior_configuration_in_correct_order()
        {
            var config = new FubuConfiguration(null);
            new BehaviorExpression(config).Will<TestBehavior>().Will<TestBehavior2>();

            config.GetDefaultBehaviors().ShouldHaveTheSameElementsAs(typeof(TestBehavior), typeof(TestBehavior2));
        }
 public void SetUp()
 {
     _conv = new FubuConventions();
     DebugMode = true;
     _config = new FubuConfiguration(_conv);
     _configurer = new DebugOutputActionConfigurer(_conv, _config);
 }
Esempio n. 3
0
        public void SetUp()
        {
            _conventions = new FubuConventions();
            _config = new FubuConfiguration(_conventions);
            _dsl = new ControllerActionDSL(_config, _conventions);

            _dsl.ByDefault.EveryControllerAction(d => d
                .Will<TestBehavior>()
                .Will<TestBehavior2>());
        }
        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);
        }
Esempio n. 5
0
    public ControllerConfig()
    {
        var conventions = new FubuConventions();
            var configuration = new FubuConfiguration(conventions);

            var dsl = new ControllerActionDSL(configuration, conventions);

            Configure(dsl);

            //TODO: one day, these things will be conventionally discovered
            new DebugOutputActionConfigurer(conventions, configuration).Configure();
            new NotFoundActionConfigurer(configuration).Configure();

            var configurer = new StructureMapConfigurer(conventions, configuration);
            configurer.ConfigureRegistry(this);
    }
Esempio n. 6
0
        public void SetUp()
        {
            _root = "fake";
            _actionUrl = "test/someaction";
            _controllerUrl = "test";
            UrlContext.Stub(_root);

            _conventions = new FubuConventions();
            _config = new FubuConfiguration(_conventions);

            var method = ReflectionHelper.GetMethod<TestController>(c => c.SomeAction(null));
            var actionConfig = new ControllerActionConfig(method, null, null);

            actionConfig.PrimaryUrl = _actionUrl;

            _config.AddControllerActionConfig(actionConfig);
        }
        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 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);
        }
Esempio n. 9
0
 public DebugController(FubuConventions conventions, FubuConfiguration configuration)
 {
     _conventions = conventions;
     _configuration = configuration;
 }
 public DebugOutputActionConfigurer(FubuConventions conventions, FubuConfiguration configuration)
 {
     _conventions = conventions;
     _config = configuration;
 }
 public NotFoundActionConfigurer(FubuConfiguration configuration)
 {
     _config = configuration;
 }
Esempio n. 12
0
 public DebugController(FubuConventions conventions, FubuConfiguration configuration)
 {
     _conventions   = conventions;
     _configuration = configuration;
 }