Example #1
0
        protected IBuilder Activate(BusConfiguration busConfiguration, ConfigBase featureConfig, string connectionString = "")
        {
            var builder = new TestBuilder();

            busConfiguration.UseContainer(builder);
            var configure      = (Configure)typeof(BusConfiguration).GetMethod("BuildConfiguration", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(busConfiguration, new object[0]);
            var featureContext = (FeatureConfigurationContext)typeof(FeatureConfigurationContext).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new[]
            {
                typeof(Configure)
            }, new ParameterModifier[0]).Invoke(new object[]
            {
                configure
            });
            var settings = busConfiguration.GetSettings();

            featureConfig.SetUpDefaults(settings);
            featureConfig.Configure(featureContext, connectionString);

            builder.CallAllFactories();
            Builder          = configure.Builder;
            PipelineExecutor = new PipelineExecutor(settings, configure.Builder);
            return(configure.Builder);
        }