public void ShouldProperlyValidateDeadLetterExchangeTypeWhenResendingFailedMessagesIsEnabled(string exchangeName, string type, bool expectedResult) { var specification = new ValidDeadLetterExchangeTypeSpecification(); var options = new RabbitMqExchangeOptions { DeadLetterExchange = exchangeName, DeadLetterExchangeType = type }; var result = specification.IsSatisfiedBy(options); Assert.Equal(expectedResult, result); }
private static void ValidateExchangeTypes(string exchangeName, RabbitMqExchangeOptions options) { var exchangeSpecification = new ValidExchangeTypeSpecification(); if (!exchangeSpecification.IsSatisfiedBy(options)) { throw new InvalidExchangeTypeException(exchangeName, options.Type); } var deadLetterExchangeSpecification = new ValidDeadLetterExchangeTypeSpecification(); if (!deadLetterExchangeSpecification.IsSatisfiedBy(options)) { throw new InvalidExchangeTypeException(options.DeadLetterExchange, options.DeadLetterExchangeType); } }