本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}