using NATS.Server.TestUtilities;

namespace NATS.Server.JetStream.Tests;

public class JetStreamPullConsumerContractTests
{
    [Fact]
    public async Task Pull_fetch_no_wait_returns_immediately_when_empty()
    {
        await using var fx = await JetStreamApiFixture.StartWithPullConsumerAsync();

        var batch = await fx.FetchWithNoWaitAsync("ORDERS", "PULL", batch: 1);
        batch.Messages.Count.ShouldBe(0);
        batch.TimedOut.ShouldBeFalse();
    }
}
