public void Should_use_case_insensitive_keys_for_property_quotas()
        {
            var options1 = new PropertyQuotaOptions();
            var options2 = new PropertyQuotaOptions();
            var options3 = new PropertyQuotaOptions();

            builder.SetPropertyQuota("prop1", options1);
            builder.SetPropertyQuota("prop2", options2);
            builder.SetPropertyQuota("PROP2", options3);

            var config = builder.Build();

            config.PropertyQuotas.Should().HaveCount(2);
            config.PropertyQuotas["prop1"]().Should().BeSameAs(options1);
            config.PropertyQuotas["prop2"]().Should().BeSameAs(options3);
        }
Beispiel #2
0
 public ThrottlingConfigurationBuilder SetMethodQuota([NotNull] PropertyQuotaOptions options)
 => SetPropertyQuota(WellKnownThrottlingProperties.Method, options);
Beispiel #3
0
 public ThrottlingConfigurationBuilder SetConsumerQuota([NotNull] PropertyQuotaOptions options)
 => SetPropertyQuota(WellKnownThrottlingProperties.Consumer, options);
Beispiel #4
0
        public ThrottlingConfigurationBuilder SetPropertyQuota([NotNull] string propertyName, [NotNull] PropertyQuotaOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            return(SetPropertyQuota(propertyName, () => options));
        }