Example #1
0
        public void TestSetup()
        {
            essentials = new ThrottlingEssentials
            {
                Enabled = true,
                CapacityLimitPerCore = 10,
                QueueLimit           = 123,
                RefreshPeriod        = 1.Seconds()
            };

            builder = new ThrottlingConfigurationBuilder();
            builder.SetEssentials(() => essentials);

            state = new ThrottlingState();
        }
Example #2
0
        public void TestSetup()
        {
            essentials = new ThrottlingEssentials {
                RefreshPeriod = TimeSpan.Zero
            };

            configuration = new ThrottlingConfigurationBuilder()
                            .SetEssentials(() => essentials)
                            .Build();

            actualizer = Substitute.For <IThrottlingStateActualizer>();
            provider   = new ThrottlingStateProvider(configuration, actualizer);

            state = provider.ObtainState();

            actualizer.ClearReceivedCalls();
        }