Exemplo n.º 1
0
        public void ThrottleAsync_should_reject_if_quotas_recheck_after_waiting_fails()
        {
            quota2.Check(properties, state).Returns(ThrottlingQuotaVerdict.Allow(), ThrottlingQuotaVerdict.Reject("for reasons"));

            DrainSemaphore();

            var task = ThrottleAsync();

            state.Semaphore.Release();

            task.Result.Status.Should().Be(ThrottlingStatus.RejectedDueToQuota);

            VerifyThereAreNoSideEffects(1);

            quota2.Received(2).Check(properties, state);
        }
Exemplo n.º 2
0
        public void ThrottleAsync_should_reject_when_quotas_check_fails()
        {
            quota2.Check(properties, state).Returns(ThrottlingQuotaVerdict.Reject("for reasons"));

            Throttle().Status.Should().Be(ThrottlingStatus.RejectedDueToQuota);
        }