Esempio n. 1
0
        public ChainedBehaviorExpression Route(string pattern)
        {
            var expression = new ExplicitRouteConfiguration(pattern);

            _explicits.Add(expression);

            return(expression.Chain());
        }
Esempio n. 2
0
        /// <summary>
        ///   Expression builder for defining and configuring a <see cref = "BehaviorChain" /> for a specific route
        /// </summary>
        public ExplicitRouteConfiguration.ChainedBehaviorExpression Route(string pattern)
        {
            var expression = new ExplicitRouteConfiguration(pattern);

            _configuration.AddConfiguration(expression, ConfigurationType.Explicit);

            return(expression.Chain());
        }
Esempio n. 3
0
        public ChainedBehaviorExpression Route <T>(string pattern)
        {
            // TODO:  Throw exception in the chained expression if the input types
            // do not match
            var expression = new ExplicitRouteConfiguration <T>(pattern);

            _explicits.Add(expression);

            return(expression.Chain());
        }
        public void SetUp()
        {
            var config = new ExplicitRouteConfiguration("some/pattern");

            config.Chain();
            _config = config;
            _graph  = new FubuRegistry(registry =>
            {
                registry.Route <InputModel>("some/pattern")
                .Calls <InputController>(c => c.DoSomething(null)).OutputToJson();
            })
                      .BuildGraph();

            _graph.Behaviors.ShouldHaveCount(1);
            _config.Configure(_graph);
        }
        public void SetUp()
        {
            var config = new ExplicitRouteConfiguration("some/pattern");

            config.Chain();
            _config = config;
            var fubuRegistry = new FubuRegistry(registry =>
            {
                registry.Actions.IncludeTypes(x => false);

                registry.Route("some/pattern")
                .Calls <InputController>(c => c.DoSomething(null)).OutputToJson();
            });

            _graph = BehaviorGraph.BuildFrom(fubuRegistry);

            _graph.Behaviors.Count().ShouldEqual(1);
            _config.Configure(_graph);
        }