Implement deferred core utility parity APIs/tests and refresh tracking artifacts
This commit is contained in:
@@ -22,6 +22,17 @@ namespace ZB.MOM.NatsNet.Server.Tests.Internal;
|
||||
/// </summary>
|
||||
public sealed class RateCounterTests
|
||||
{
|
||||
[Fact]
|
||||
public void NewRateCounter_ShouldCreateWithDefaultInterval()
|
||||
{
|
||||
var counter = RateCounter.NewRateCounter(2);
|
||||
counter.Interval.ShouldBe(TimeSpan.FromSeconds(1));
|
||||
|
||||
counter.Allow().ShouldBeTrue();
|
||||
counter.Allow().ShouldBeTrue();
|
||||
counter.Allow().ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RateCounter_ShouldAllowUpToLimitThenBlockAndReset()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user