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


C# WindsorContainer.ConfigureWiringForTestsCallBeforeAllOtherWiring方法代码示例

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


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

示例1: SetUpContainerAndBeginScope

 public void SetUpContainerAndBeginScope()
 {
     Container = new WindsorContainer();
     Container.ConfigureWiringForTestsCallBeforeAllOtherWiring();
     Container.Register(
         Component.For<SynchronousBus>(),
         Component.For<EventsReplayer>(),
         Component.For<IWindsorContainer>().Instance(Container));
     new MessageHandlersRegister().RegisterMessageHandlersForTestingFromAssemblyContaining<MessageHandlersTestBase>(Container);
     Container.ConfigureWiringForTestsCallAfterAllOtherWiring();
     _scope = Container.BeginScope();
 }
开发者ID:RichieYang,项目名称:Composable.Monolithic,代码行数:12,代码来源:MessageHandlersTestBase.cs

示例2: SetupContainer

        public void SetupContainer()
        {
            _container = new WindsorContainer();
            _container.ConfigureWiringForTestsCallBeforeAllOtherWiring();
            ApplicationBootstrapper.ConfigureContainer(_container);

            _container.Register(
                Component.For<IServiceBus>().ImplementedBy<SynchronousBus>()
                    .Named("TestReplacementServiceBus")
                    .LifestylePerWebRequest()
                    .IsDefault()
                );

            _container.ConfigureWiringForTestsCallAfterAllOtherWiring();
        }
开发者ID:mlidbom,项目名称:Composable.Monolithic,代码行数:15,代码来源:WebApplicationBootstrapperTests.cs

示例3: SetupContainerAndScope

        public void SetupContainerAndScope()
        {
            Container = new WindsorContainer();
            Container.ConfigureWiringForTestsCallBeforeAllOtherWiring();
            Container.Install(
                FromAssembly.Containing<Domain.ContainerInstallers.AccountRepositoryInstaller>(),
                FromAssembly.Containing<Domain.Events.EventStore.ContainerInstallers.AccountManagementDomainEventStoreInstaller>(),
                FromAssembly.Containing<UI.QueryModels.ContainerInstallers.AccountManagementDocumentDbReaderInstaller>(),
                FromAssembly.Containing<UI.QueryModels.DocumentDB.Updaters.ContainerInstallers.AccountManagementQuerymodelsSessionInstaller>()
                );

            Container.Register(
                Component.For<IWindsorContainer>().Instance(Container),
                Component.For<IServiceBus>().ImplementedBy<SynchronousBus>()
                );

            Container.ConfigureWiringForTestsCallAfterAllOtherWiring();
            _scope = Container.BeginScope();
        }
开发者ID:RichieYang,项目名称:Composable.Monolithic,代码行数:19,代码来源:QueryModelsTestsBase.cs

示例4: SetupContainerForTesting

        public static WindsorContainer SetupContainerForTesting()
        {
            var container = new WindsorContainer();
            container.ConfigureWiringForTestsCallBeforeAllOtherWiring();

            container.Register(
                Component.For<MessageSpy, IHandleMessages<IMessage>>().Instance(new MessageSpy()),
                Component.For<IUtcTimeTimeSource, DummyTimeSource>().Instance(DummyTimeSource.Now).LifestyleSingleton(),
                Component.For<IServiceBus>().ImplementedBy<SynchronousBus>().LifestylePerWebRequest(),
                Component.For<IWindsorContainer>().Instance(container),
                Component.For<IConnectionStringProvider>().Instance(new ConnectionStringConfigurationParameterProvider()).LifestyleSingleton()
                );

            container.Install(
                FromAssembly.Containing<Domain.ContainerInstallers.AccountRepositoryInstaller>(),
                FromAssembly.Containing<Domain.Events.EventStore.ContainerInstallers.AccountManagementDomainEventStoreInstaller>()
                );          

            container.ConfigureWiringForTestsCallAfterAllOtherWiring();
            return container;
        }
开发者ID:mlidbom,项目名称:Composable.Monolithic,代码行数:21,代码来源:DomainTestWiringHelper.cs

示例5: SetupContainerForTesting

        public static WindsorContainer SetupContainerForTesting()
        {
            var container = new WindsorContainer();
            container.ConfigureWiringForTestsCallBeforeAllOtherWiring();
            container.Install(
                FromAssembly.Containing<Domain.ContainerInstallers.AccountRepositoryInstaller>(),
                FromAssembly.Containing<Domain.Events.EventStore.ContainerInstallers.AccountManagementDomainEventStoreInstaller>()
                );

            container.Register(
                Component.For<MessageSpy, IHandleMessages<IMessage>>().Instance(new MessageSpy())
                );

            container.Register(
                Component.For<IServiceBus>().ImplementedBy<SynchronousBus>().LifestylePerWebRequest(),
                Component.For<IWindsorContainer>().Instance(container)
                );

            container.ConfigureWiringForTestsCallAfterAllOtherWiring();
            return container;
        }
开发者ID:RichieYang,项目名称:Composable.Monolithic,代码行数:21,代码来源:DomainTestWiringHelper.cs

示例6: SetupContainerAndScope

        public void SetupContainerAndScope()
        {
            Container = new WindsorContainer();
            Container.ConfigureWiringForTestsCallBeforeAllOtherWiring();

            Container.Register(
                Component.For<IUtcTimeTimeSource, DummyTimeSource>().Instance(DummyTimeSource.Now).LifestyleSingleton(),
                Component.For<IWindsorContainer>().Instance(Container),
                Component.For<IServiceBus>().ImplementedBy<SynchronousBus>(),
                Component.For<IConnectionStringProvider>().Instance(new ConnectionStringConfigurationParameterProvider()).LifestyleSingleton()
                );

            Container.Install(
                FromAssembly.Containing<Domain.ContainerInstallers.AccountRepositoryInstaller>(),
                FromAssembly.Containing<Domain.Events.EventStore.ContainerInstallers.AccountManagementDomainEventStoreInstaller>(),
                FromAssembly.Containing<UI.QueryModels.ContainerInstallers.AccountManagementDocumentDbReaderInstaller>(),
                FromAssembly.Containing<UI.QueryModels.DocumentDB.Updaters.ContainerInstallers.AccountManagementQuerymodelsSessionInstaller>()
                );            

            Container.ConfigureWiringForTestsCallAfterAllOtherWiring();
            _scope = Container.BeginScope();
        }
开发者ID:mlidbom,项目名称:Composable.Monolithic,代码行数:22,代码来源:QueryModelsTestsBase.cs

示例7: CreateContainerForEventStoreType

        protected static WindsorContainer CreateContainerForEventStoreType(Func<IReadOnlyList<IEventMigration>> migrationsfactory, Type eventStoreType, string eventStoreConnectionString = null)
        {
            var container = new WindsorContainer();

            container.ConfigureWiringForTestsCallBeforeAllOtherWiring();

            container.Register(
                Component.For<IUtcTimeTimeSource, DummyTimeSource>()
                    .Instance(DummyTimeSource.Now)
                    .LifestyleSingleton(),
                Component.For<IServiceBus>()
                         .ImplementedBy<SynchronousBus>()
                         .LifestylePerWebRequest(),
                Component.For<IEnumerable<IEventMigration>>()
                         .UsingFactoryMethod(migrationsfactory)
                         .LifestylePerWebRequest(),
                Component.For<IEventStoreSession, IUnitOfWorkParticipant>()
                         .ImplementedBy<EventStoreSession>()
                         .LifestylePerWebRequest(),
                Component.For<IWindsorContainer>().Instance(container)
                );


            if (eventStoreType == typeof(SqlServerEventStore))
            {
                if(eventStoreConnectionString == null)
                {
                    var masterConnectionSTring = new ConnectionStringConfigurationParameterProvider().GetConnectionString("MasterDB");
                    var dbManager = new TemporaryLocalDbManager(masterConnectionSTring.ConnectionString, container);

                    eventStoreConnectionString = dbManager.CreateOrGetLocalDb($"{nameof(EventStreamMutatorTestsBase)}_EventStore");
                }

                container.Register(                    
                    Component.For<IEventStore>()
                             .ImplementedBy<SqlServerEventStore>()
                             .DependsOn(Dependency.OnValue<string>(eventStoreConnectionString))
                             .LifestyleScoped());

            }
            else if(eventStoreType == typeof(InMemoryEventStore))
            {
                container.Register(
                    Component.For<IEventStore>()
                             .UsingFactoryMethod(
                                 kernel =>
                                 {
                                     var store = kernel.Resolve<InMemoryEventStore>();
                                     store.TestingOnlyReplaceMigrations(migrationsfactory());
                                     return store;
                                 })
                             .LifestyleScoped(),
                    Component.For<InMemoryEventStore>()
                        .ImplementedBy<InMemoryEventStore>()
                        .LifestyleSingleton());
            }
            else
            {
                throw new Exception($"Unsupported type of event store {eventStoreType}");
            }            

            container.ConfigureWiringForTestsCallAfterAllOtherWiring();
            return container;
        }
开发者ID:mlidbom,项目名称:Composable.Monolithic,代码行数:64,代码来源:EventStreamMutatorTestsBase.cs


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