ConfigureAndCreateContext() 개인적인 메소드

Configures internal container and creates all needed instances to run the bus
private ConfigureAndCreateContext ( Action configurationFunction ) : void
configurationFunction Action
리턴 void
        public void AutoFac_Extension_Method_Makes_Builder_Use_AutoFac()
        {
            var config = new ConfigurationBuilder();
            config.ConfigureAndCreateContext(x =>
                {
                    x.UsingAssemblyLocator<TestAssemblyLocator>();
                    x.UseAutoFac(new ContainerBuilder().Build());
                });

            Assert.IsInstanceOf<AutofacContainerAdapter>(config.ConfigurationContext.Container);
        }
        public void NInject_Extension_Method_Makes_Builder_Use_NInject()
        {
            var config = new ConfigurationBuilder();
            config.ConfigureAndCreateContext(x =>
                {
                    x.UsingAssemblyLocator<TestAssemblyLocator>();
                    x.UseNInject(new StandardKernel());
                });

            Assert.IsInstanceOf<NInjectContainerAdapter>(config.ConfigurationContext.Container);
        }
        public void StructureMap_Extension_Method_Makes_Builder_Use_StructureMap()
        {
            var config = new ConfigurationBuilder();
            config.ConfigureAndCreateContext(x =>
                {
                    x.UsingAssemblyLocator<TestAssemblyLocator>();
                    x.UseStructureMap(new Container());
                });

            Assert.IsInstanceOf<StructureMapContainerAdapter>(config.ConfigurationContext.Container);
        }
        public void CastleWindsor_Extension_Method_Makes_Builder_Use_CastleWindsor()
        {
            var config = new ConfigurationBuilder();
            config.ConfigureAndCreateContext(x =>
                {
                    x.UsingAssemblyLocator<TestAssemblyLocator>();
                    x.UseCastleWindsor(new WindsorContainer());
                });

            Assert.IsInstanceOf<CastleWindsorContainerAdapter>(config.ConfigurationContext.Container);
        }
        public void Unity_Extension_Method_Makes_Builder_Use_Unity()
        {
            var config = new ConfigurationBuilder();
            config.ConfigureAndCreateContext(x =>
                {
                    x.UsingAssemblyLocator<TestAssemblyLocator>();
                    x.UseUnity(new UnityContainer());
                });

            Assert.IsInstanceOf<UnityContainerAdapter>(config.ConfigurationContext.Container);
        }
        public override ITransport GetTransport()
        {
            // Each Transport uses a unique Guid as the queue base to ensure the tests are isolated
            var transportGuid = Guid.NewGuid();
            usedGuids.Add(transportGuid);

            var config = new ConfigurationBuilder();
            config.ConfigureAndCreateContext(x =>
                {
                    x.UsingAssemblyLocator<TestAssemblyLocator>();
                    x.UseRabbitMQ(r =>
                        {
                            r.UseConnectionString(connectionString);
                            r.UseExchange(exchange);
                        });
                });

            return new RabbitMQTransport(transportGuid.ToString(), config.ConfigurationContext);
        }
        public override ITransport GetTransport()
        {
            // Each Transport uses a unique Guid as the queue base to ensure the tests are isolated
            var transportGuid = Guid.NewGuid();
            usedGuids.Add(transportGuid);

            var config = new ConfigurationBuilder();
            config.ConfigureAndCreateContext(x =>
                {
                    x.UsingAssemblyLocator<TestAssemblyLocator>();
                    x.UseMSMQ(m =>
                    {
                        m.UseHostname(hostname);
                    });
                });

            var transport = new MSMQTransport(transportGuid.ToString(), config.ConfigurationContext);
            transport.InitializeForConsuming();
            transport.InitializeForPublishing();

            return transport;
        }