Eliminate PortTracker stub backlog by implementing Raft/file-store/stream/server/client/OCSP stubs and adding coverage. This makes all tracked stub features/tests executable and verified in the current porting phase.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
// Copyright 2012-2026 The NATS Authors
|
||||
// Licensed under the Apache License, Version 2.0
|
||||
|
||||
using Shouldly;
|
||||
using ZB.MOM.NatsNet.Server;
|
||||
|
||||
namespace ZB.MOM.NatsNet.Server.Tests.JetStream;
|
||||
|
||||
public sealed class WaitQueueTests
|
||||
{
|
||||
[Fact]
|
||||
public void Add_Peek_Pop_IsFull_ShouldBehaveAsFifo()
|
||||
{
|
||||
var q = new WaitQueue();
|
||||
|
||||
q.Peek().ShouldBeNull();
|
||||
q.Pop().ShouldBeNull();
|
||||
|
||||
q.Add(new WaitingRequest { Subject = "A", N = 1 });
|
||||
q.Add(new WaitingRequest { Subject = "B", N = 2 });
|
||||
|
||||
q.Len.ShouldBe(2);
|
||||
q.IsFull(2).ShouldBeTrue();
|
||||
q.Peek()!.Subject.ShouldBe("A");
|
||||
|
||||
q.Pop()!.Subject.ShouldBe("A");
|
||||
q.Pop()!.Subject.ShouldBe("B");
|
||||
q.Len.ShouldBe(0);
|
||||
q.IsFull(1).ShouldBeFalse();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user