Esempio n. 1
0
        public void Should_include_property_quotas()
        {
            var quota1 = Substitute.For <IThrottlingQuota>();
            var quota2 = Substitute.For <IThrottlingQuota>();

            builder.AddCustomQuota(quota1);
            builder.AddCustomQuota(quota2);
            builder.SetConsumerQuota(new PropertyQuotaOptions());
            builder.SetPriorityQuota(new PropertyQuotaOptions());

            Actualize();

            state.Quotas.Should().HaveCount(4);
            state.Quotas[0].Should().BeSameAs(quota1);
            state.Quotas[1].Should().BeSameAs(quota2);
            state.Quotas[2].Should().BeOfType <PropertyQuota>().Which.Property.Should().Be(WellKnownThrottlingProperties.Consumer);
            state.Quotas[3].Should().BeOfType <PropertyQuota>().Which.Property.Should().Be(WellKnownThrottlingProperties.Priority);
        }