public void ShouldProperlyValidateExchangeType(string type, bool expectedResult) { var specification = new ValidExchangeTypeSpecification(); var options = new RabbitMqExchangeOptions { Type = 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); } }