예제 #1
0
        /// <inheritdoc />
        void IBrokerEgressDriverConfigurator.SetDriver(IBrokerEgressDriver driver, IMessageRouterConfigurationPart configuration)
        {
            if (_configuration.Driver != null)
            {
                throw new PoezdConfigurationException(
                          "It's not allowed to set driver on broker egress more than once. Inspect your message " +
                          "router configuration and eliminate excess calls to WithXXXDriver.");
            }

            _configuration.Driver = driver ?? throw new ArgumentNullException(nameof(driver));
            _configuration.DriverConfiguration = configuration ?? throw new ArgumentNullException(nameof(configuration));
        }
        public static BrokerEgressConfigurator WithSpecificDriver(this BrokerEgressConfigurator egress, IBrokerEgressDriver driver)
        {
            IBrokerEgressDriverConfigurator driverConfigurator = egress;

            driverConfigurator.SetDriver(driver, Mock.Of <IMessageRouterConfigurationPart>());
            return(egress);
        }