namespace NATS.Server.Tests;

public class JetStreamAckRedeliveryStateMachineTests
{
    [Fact]
    public async Task Ack_all_and_backoff_redelivery_follow_monotonic_floor_and_max_deliver_rules()
    {
        var violations = new List<string>();

        try
        {
            var ackAll = new JetStreamPushConsumerContractTests();
            await ackAll.Ack_all_advances_floor_and_clears_pending_before_sequence();

            var backoff = new JetStreamConsumerBackoffParityTests();
            await backoff.Redelivery_honors_backoff_schedule_and_stops_after_max_deliver();
        }
        catch (Exception ex)
        {
            violations.Add(ex.Message);
        }

        violations.ShouldBeEmpty();
    }
}
