protected override void Setup(FeatureConfigurationContext context) { PipelineSettings pipeline = context.Pipeline; pipeline.Replace("NServiceBus.DeserializeLogicalMessagesConnector", typeof(DeserializeConnector)); pipeline.Replace("NServiceBus.SerializeMessageConnector", typeof(SerializeConnector)); context.Container.ConfigureComponent <SerializationMapper>(DependencyLifecycle.SingleInstance); }
public void Register_ThrowsWhenChangesArePrevented() { var settingsHolder = new SettingsHolder(); var pipelineSettings = new PipelineSettings(settingsHolder); pipelineSettings.PreventChanges(); Assert.Throws <InvalidOperationException>(() => pipelineSettings.Register(typeof(Behavior1), "newStep")); Assert.Throws <InvalidOperationException>(() => pipelineSettings.Replace("newStep", typeof(Behavior1))); }