public void not_exceeding_threshold_should_not_invoke_provided_action()
        {
            bool wasInvoked = false;
            var requestCounter = new Marten.Services.RequestCounter(new FakeCommandRunner(), new RequestCounterThreshold(2, () => wasInvoked = true));

            requestCounter.Execute("sql");
            requestCounter.Execute("sql");

            wasInvoked.ShouldBe(false);
        }
Ejemplo n.º 2
0
        public void not_exceeding_threshold_should_not_invoke_provided_action()
        {
            bool wasInvoked     = false;
            var  requestCounter = new Marten.Services.RequestCounter(new FakeCommandRunner(), new RequestCounterThreshold(2, () => wasInvoked = true));

            requestCounter.Execute("sql");
            requestCounter.Execute("sql");

            wasInvoked.ShouldBe(false);
        }