namespace NATS.Server.Core.Tests;

public class ClientClosedReasonTests
{
    [Fact]
    public void All_expected_close_reasons_exist()
    {
        // Verify all 18 enum values exist and are distinct (None + 17 named reasons)
        var values = Enum.GetValues<ClientClosedReason>();
        values.Length.ShouldBe(18);
        values.Distinct().Count().ShouldBe(18);
    }

    [Theory]
    [InlineData(ClientClosedReason.ClientClosed, "Client Closed")]
    [InlineData(ClientClosedReason.SlowConsumerPendingBytes, "Slow Consumer (Pending Bytes)")]
    [InlineData(ClientClosedReason.SlowConsumerWriteDeadline, "Slow Consumer (Write Deadline)")]
    [InlineData(ClientClosedReason.StaleConnection, "Stale Connection")]
    [InlineData(ClientClosedReason.ServerShutdown, "Server Shutdown")]
    public void ToReasonString_returns_human_readable_description(ClientClosedReason reason, string expected)
    {
        reason.ToReasonString().ShouldBe(expected);
    }
}
