public void SetUp()
        {
            _runtime = FubuRuntime.For<ApplicationRegistry>();
            behaviors = _runtime.Get<BehaviorGraph>();

            appChain = behaviors.ChainFor<ApplicationActions>(x => x.get_app_action());
            pakChain = behaviors.ChainFor<PackageActions>(x => x.get_pak_action());
        }
        public void SetUp()
        {
            theHttpRequest = OwinHttpRequest.ForTesting();
            UrlContext.Stub("http://server");

            theUrlResolver = new ChainUrlResolver(theHttpRequest);

            theGraph = BehaviorGraph.BuildFrom(registry =>
            {
                registry.Actions.IncludeType<ChainUrlResolverEndpoint>();
            });

            theSimpleChain = theGraph.ChainFor<ChainUrlResolverEndpoint>(x => x.get_index());
            theChainWithRouteParams = theGraph.ChainFor(typeof(ChainUrlParams));
        }
        public void SetUp()
        {
            var registry = new FubuRegistry(x => {
                x.Actions.IncludeClassesSuffixedWithController();

                x.Configure(g =>
                {
                    g.ChainFor<AuthorizedController>(c => c.Go(null)).Authorization.AddRole("RoleA");
                });
            });

            graph = BehaviorGraph.BuildFrom(registry);

            goChain = graph.ChainFor<AuthorizedController>(x => x.Go(null));
            moveChain = graph.ChainFor<AuthorizedController>(x => x.Move(null));
        }
Example #4
0
        public void should_throw_an_exception_if_the_result_is_not_unique()
        {
            var call1 = ActionCall.For<Issue101Endpoint>(x => x.get_hello());
            var call2 = ActionCall.For<Issue101Endpoint>(x => x.get_hello());

            var graph = new BehaviorGraph();
            graph.AddChain().AddToEnd(call1);
            graph.AddChain().AddToEnd(call2);

            Exception<FubuException>.ShouldBeThrownBy(() => {
                graph.ChainFor<Issue101Endpoint>(x => x.get_hello());
            });
        }
        public void SetUp()
        {
            container = new Container();
            container.Inject(new TransportSettings
            {
                DelayMessagePolling = Int32.MaxValue,
                ListenerCleanupPolling = Int32.MaxValue
            });
            theServiceBus = MockRepository.GenerateMock<IServiceBus>();

            var registry = new FubuRegistry();
            registry.ServiceBus.Enable(true);
            registry.Actions.IncludeType<MessageOnePublisher>();
            registry.StructureMap(container);
            registry.AlterSettings<LightningQueueSettings>(x => x.DisableIfNoChannels = true);

            theRuntime = registry.ToRuntime();
            theGraph = theRuntime.Get<BehaviorGraph>();
            chain = theGraph.ChainFor<MessageOnePublisher>(x => x.post_message1(null));

            container.Inject(theServiceBus);
        }