/// <summary>
        /// Configure and create an in-memory bus
        /// </summary>
        /// <param name="configure">The configuration callback to configure the bus</param>
        /// <returns></returns>
        public static IBusControl Create(Action<IInMemoryBusFactoryConfigurator> configure)
        {
            var configurator = new InMemoryBusFactoryConfigurator();

            configure(configurator);

            return configurator.Build();
        }
Beispiel #2
0
        /// <summary>
        /// Configure and create an in-memory bus
        /// </summary>
        /// <param name="baseAddress">Override the default base address</param>
        /// <param name="configure">The configuration callback to configure the bus</param>
        /// <returns></returns>
        public static IBusControl Create(Uri baseAddress, Action <IInMemoryBusFactoryConfigurator> configure)
        {
            var configurator = new InMemoryBusFactoryConfigurator(CreateEndpointConfiguration(), baseAddress);

            configure(configurator);

            return(configurator.Build());
        }
Beispiel #3
0
        /// <summary>
        /// Configure and create an in-memory bus
        /// </summary>
        /// <param name="configure">The configuration callback to configure the bus</param>
        /// <returns></returns>
        public static IBusControl Create(Action <IInMemoryBusFactoryConfigurator> configure)
        {
            var configurator = new InMemoryBusFactoryConfigurator();

            configure(configurator);

            return(configurator.Build());
        }
Beispiel #4
0
        /// <summary>
        /// Configure and create an in-memory bus
        /// </summary>
        /// <param name="baseAddress">Override the default base address</param>
        /// <param name="configure">The configuration callback to configure the bus</param>
        /// <returns></returns>
        public static IBusControl Create(Uri baseAddress, Action <IInMemoryBusFactoryConfigurator> configure)
        {
            var topologyConfiguration = new InMemoryTopologyConfiguration(MessageTopology);
            var busConfiguration      = new InMemoryBusConfiguration(topologyConfiguration, baseAddress);

            var configurator = new InMemoryBusFactoryConfigurator(busConfiguration);

            configure(configurator);

            return(configurator.Build());
        }
Beispiel #5
0
        protected override IBusControl CreateBus()
        {
            var configurator = new InMemoryBusFactoryConfigurator(_busConfiguration);

            ConfigureBus(configurator);

            ConfigureInMemoryBus(configurator);

            configurator.ReceiveEndpoint(InputQueueName, e =>
            {
                ConfigureReceiveEndpoint(e);

                ConfigureInMemoryReceiveEndpoint(e);
            });
            return(configurator.Build(_busConfiguration, _specifications ?? Enumerable.Empty <ISpecification>()));
        }
Beispiel #6
0
        public virtual IBusTestScenario Build()
        {
            var scenario = new BusTestScenario(Timeout, _configurator.Build());

            return(scenario);
        }