Inheritance: FubuMVC.Core.Registration.Nodes.BehaviorNode
示例#1
0
        public void adds_the_authentication_node_if_it_exists()
        {
            var registry = new FubuRegistry();
            registry.Actions.IncludeType<AuthenticatedEndpoint>();
            registry.Configure(
                graph => { graph.Chains.OfType<RoutedChain>().Each(x => x.Authentication = new AuthNode()); });

            using (var runtime = registry.ToRuntime())
            {
                runtime.Behaviors.ChainFor<AuthenticatedEndpoint>(x => x.get_hello())
                    .First().ShouldBeOfType<AuthNode>();
            }


            var chain = new RoutedChain("something");
            var auth = new AuthNode();
            chain.Authentication = auth;
        }
示例#2
0
        public void adds_the_authentication_node_if_it_exists()
        {
            var registry = new FubuRegistry();

            registry.Actions.IncludeType <AuthenticatedEndpoint>();
            registry.Configure(
                graph => { graph.Chains.OfType <RoutedChain>().Each(x => x.Authentication = new AuthNode()); });

            using (var runtime = registry.ToRuntime())
            {
                runtime.Behaviors.ChainFor <AuthenticatedEndpoint>(x => x.get_hello())
                .First().ShouldBeOfType <AuthNode>();
            }


            var chain = new RoutedChain("something");
            var auth  = new AuthNode();

            chain.Authentication = auth;
        }