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); }
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); }