当前位置: 首页>>代码示例>>C#>>正文


C# FubuRegistry.ToRuntime方法代码示例

本文整理汇总了C#中FubuMVC.Core.FubuRegistry.ToRuntime方法的典型用法代码示例。如果您正苦于以下问题:C# FubuRegistry.ToRuntime方法的具体用法?C# FubuRegistry.ToRuntime怎么用?C# FubuRegistry.ToRuntime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FubuMVC.Core.FubuRegistry的用法示例。


在下文中一共展示了FubuRegistry.ToRuntime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

        public void Start()
        {
            _controller = _input.BuildRemoteController();
            var context = new StorytellerContext(_controller, _input);

            if (_controller.BinPath.IsEmpty())
            {
                throw new Exception("Could not determine any BinPath for the testing AppDomain. Has the Storyteller specification project been compiled, \nor is Storyteller using the wrong compilation target maybe?\n\ntype 'st.exe ? open' or st.exe ? run' to see the command usages\n\n");
            }

            context.Start();

            var registry = new FubuRegistry();


            registry.AlterSettings<DiagnosticsSettings>(_ => _.TraceLevel = TraceLevel.Verbose);
            registry.Mode = "development";
            registry.HostWith<NOWIN>();
            registry.Services.For<IRemoteController>().Use(_controller);
            registry.Services.For<StorytellerContext>().Use(context);
            
            registry.Services.IncludeRegistry<WebApplicationRegistry>();


            _server = registry.ToRuntime();
        }
开发者ID:jamesmanning,项目名称:Storyteller,代码行数:26,代码来源:WebApplicationRunner.cs

示例2: see_tracing_logs_in_verbose_mode_happy_path

        public void see_tracing_logs_in_verbose_mode_happy_path()
        {
            var registry = new FubuRegistry();
            registry.ServiceBus.Enable(true);
            registry.Features.Diagnostics.Enable(TraceLevel.Verbose);
            registry.ServiceBus.EnableInMemoryTransport();
            registry.AlterSettings<LightningQueueSettings>(x => x.DisableIfNoChannels = true);

            using (var runtime = registry.ToRuntime())
            {
                var bus = runtime.Get<IServiceBus>();

                bus.Consume(new TracedInput());

                var history = runtime.Get<IChainExecutionHistory>();

                var log = history.RecentReports().Single(x => x.RootChain != null && x.RootChain.InputType() == typeof(TracedInput));

                log.Request["headers"].ShouldBeOfType<Dictionary<string, string>>();
                
                log.Steps.Any().ShouldBeTrue();
                log.Steps.Any(x => x.Log is StringMessage).ShouldBeTrue();

                log.Steps.Each(x => Debug.WriteLine(x));
            }
        }
开发者ID:DarthFubuMVC,项目名称:fubumvc,代码行数:26,代码来源:end_to_end_diagnostics_specs.cs

示例3: can_inject_the_right_html_on_GET_for_html_text

        public void can_inject_the_right_html_on_GET_for_html_text()
        {
            var registry = new FubuRegistry();
            registry.AlterSettings<OwinSettings>(x =>
            {
                x.AddMiddleware<HtmlHeadInjectionMiddleware>().Arguments.With(new InjectionOptions
                {
                    Content = e => new HtmlTag("script").Attr("foo", "bar").ToString()
                });
            });

            using (var server = registry.ToRuntime())
            {
                server.Scenario(_ =>
                {
                    _.Get.Action<SimpleHtmlEndpoint>(x => x.get_html_content());

                    _.ContentShouldContain("<script foo=\"bar\"></script></head>");
                });

                server.Scenario(_ =>
                {
                    _.Get.Action<SimpleHtmlEndpoint>(x => x.get_text_content());

                    _.ContentShouldNotContain("<script foo=\"bar\"></script></head>");
                });
            }
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:28,代码来源:HtmlHeadInjectionMiddlewareTester.cs

示例4: is_registered

        public void is_registered()
        {
            var registry = new FubuRegistry();
            registry.AlterSettings<CommonViewNamespaces>(x =>
            {
                x.Add("Foo");
                x.Add("Bar");
            });

            using (var runtime = registry.ToRuntime())
            {
                var container = runtime.Get<IContainer>();

                var useNamespaces = container.GetInstance<CommonViewNamespaces>();

                useNamespaces.Namespaces.ShouldContain(typeof (VirtualPathUtility).Namespace);
                useNamespaces.Namespaces.ShouldContain(typeof (string).Namespace);
                useNamespaces.Namespaces.ShouldContain(typeof (FileSet).Namespace);
                useNamespaces.Namespaces.ShouldContain(typeof (ParallelQuery).Namespace);
                useNamespaces.Namespaces.ShouldContain(typeof (HtmlTag).Namespace);
                useNamespaces.Namespaces.ShouldContain("FubuMVC.Tests.Http.Hosting");
                useNamespaces.Namespaces.ShouldContain("Foo");
                useNamespaces.Namespaces.ShouldContain("Bar");
            }
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:25,代码来源:CommonViewNamespaces_is_registered.cs

示例5: can_set_the_node_name_programmatically

        public void can_set_the_node_name_programmatically()
        {
            var registry = new FubuRegistry {NodeName = "MyNode"};

            using (var fubuRuntime = registry.ToRuntime())
            {
                fubuRuntime.Get<ChannelGraph>().Name.ShouldBe("MyNode");
            }
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:9,代码来源:FubuTransportRegistryTester.cs

示例6: register_a_non_default_culture_info

        public void register_a_non_default_culture_info()
        {
            var registry = new FubuRegistry();
            registry.Features.Localization.Enable(true);
            registry.Features.Localization.Configure(x => { x.DefaultCulture = new CultureInfo("en-CA"); });

            using (var runtime = registry.ToRuntime())
            {
                runtime.Get<CultureInfo>().Name.ShouldBe("en-CA");
            }
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:11,代码来源:LocalizationBootstrappingTester.cs

示例7: SetUp

        public void SetUp()
        {
            var registry = new FubuRegistry(x =>
            {
                x.Actions.IncludeType<AsyncAction>();
                x.Policies.Local.Add<EarlyReturnConvention>();
                x.HostWith<Katana>();
            });

            _server = registry.ToRuntime();
        }
开发者ID:DarthFubuMVC,项目名称:fubumvc,代码行数:11,代码来源:AsyncRouteIntegrationTester.cs

示例8: AuthenticationSetup

        public void AuthenticationSetup()
        {
            var registry = new FubuRegistry();
            configure(registry);

            registry.Features.Authentication.Enable(true);

            server = registry.ToRuntime();
            theContainer = server.Get<IContainer>();

            beforeEach();
        }
开发者ID:cothienlac86,项目名称:fubumvc,代码行数:12,代码来源:AuthenticationHarness.cs

示例9: should_start_when_transport_disabled

 public void should_start_when_transport_disabled()
 {
     var registry = new FubuRegistry();
     registry.AlterSettings<TransportSettings>(x =>
     {
         x.Enabled = true;
         x.InMemoryTransport = InMemoryTransportMode.Enabled;
     });
     registry.AlterSettings<LightningQueueSettings>(x => x.DisableIfNoChannels = true);
     using (var application = registry.ToRuntime())
     {
     }
 }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:13,代码来源:FubuTransportRegistryActivationTester.cs

示例10: can_happily_plug_in_an_alternative_route_policy

        public void can_happily_plug_in_an_alternative_route_policy()
        {
            FakeRoutePolicy.IWasCalled = false;

            var registry = new FubuRegistry();
            registry.RoutePolicy<FakeRoutePolicy>();

            using (var runtime = registry.ToRuntime())
            {
            }

            FakeRoutePolicy.IWasCalled.ShouldBeTrue();
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:13,代码来源:Using_a_custom_routing_policy.cs

示例11: end_to_end

        public void end_to_end()
        {
            var registry = new FubuRegistry();
            registry.Features.ServerSentEvents.Enable(true);

            using (var runtime = registry.ToRuntime())
            {
                var chain = runtime.Behaviors.ChainFor<ChannelWriter<FakeTopic>>(x => x.Write(null));
                var container = runtime.Get<IContainer>();
                container.GetInstance<IChannelInitializer<FakeTopic>>()
                    .ShouldBeOfType<DefaultChannelInitializer<FakeTopic>>();

                container.GetInstance<IActionBehavior>(chain.UniqueId.ToString());
            }
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:15,代码来源:ServerSentEventExtensionIntegratedTester.cs

示例12: the_order_of_the_configuration_action_was_wrong

        public void the_order_of_the_configuration_action_was_wrong()
        {
            var registry = new FubuRegistry();
            registry.Actions.IncludeType<TestEndpoint>();
            registry.Features.AntiForgery.Enable(true);

            using (var runtime = registry.ToRuntime())
            {
                var graph = runtime.Get<BehaviorGraph>();

                graph.ChainFor<TestEndpoint>(x => x.post_csrf(null))
                    .OfType<AntiForgeryNode>().Any()
                    .ShouldBeTrue();
            }
        }
开发者ID:cothienlac86,项目名称:fubumvc,代码行数:15,代码来源:Default_policy_applies_anti_forgery_to_post_routes.cs

示例13: register_services

        public void register_services()
        {
            var registry = new FubuRegistry();
            registry.Features.ServerSentEvents.Enable(true);

            using (var runtime = registry.ToRuntime())
            {
                var container = runtime.Get<IContainer>();

                container.DefaultRegistrationIs<IEventPublisher, EventPublisher>();
                container.DefaultRegistrationIs<IServerEventWriter, ServerEventWriter>();
                container.DefaultRegistrationIs(typeof (IEventQueueFactory<>), typeof (DefaultEventQueueFactory<>));

                container.DefaultSingletonIs<ITopicChannelCache, TopicChannelCache>();
            }
        }
开发者ID:cothienlac86,项目名称:fubumvc,代码行数:16,代码来源:ServicesRegistrationTester.cs

示例14: can_register_custom_binding_services

        public void can_register_custom_binding_services()
        {
            var registry = new FubuRegistry();
            registry.Models
                .BindModelsWith<ExampleModelBinder>()
                .BindPropertiesWith<ExamplePropertyBinder>()
                .ConvertUsing<ExampleConverter>();

            using (var runtime = registry.ToRuntime())
            {
                var container = runtime.Get<IContainer>();
                container.ShouldHaveRegistration<IConverterFamily, ExampleConverter>();
                container.ShouldHaveRegistration<IPropertyBinder, ExamplePropertyBinder>();
                container.ShouldHaveRegistration<IModelBinder, ExampleModelBinder>();
            }
        }
开发者ID:cothienlac86,项目名称:fubumvc,代码行数:16,代码来源:ModelExpressionTester.cs

示例15: should_place_composite_error_handler

        public void should_place_composite_error_handler()
        {
            var registry = new FubuRegistry();
            registry.ServiceBus.Enable(true);
            registry.Handlers.Include<MyConsumer>();
            registry.ServiceBus.EnableInMemoryTransport();

            registry.Policies.Global.Add<RespondThenMoveToErrorsPolicy>();

            using (var runtime = registry.ToRuntime())
            {
                runtime.Behaviors.Handlers.Each(x =>
                {
                    x.ErrorHandlers.Count.ShouldBe(1);
                });
            }
        }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:17,代码来源:CompositeContinuationConfigurationTester.cs


注:本文中的FubuMVC.Core.FubuRegistry.ToRuntime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。