using StellaOps.Feedser.Models;

namespace StellaOps.Feedser.Models.Tests;

public sealed class SeverityNormalizationTests
{
    [Theory]
    [InlineData("CRITICAL", "critical")]
    [InlineData("Important", "high")]
    [InlineData("moderate", "medium")]
    [InlineData("Minor", "low")]
    [InlineData("Info", "informational")]
    [InlineData("negligible", "none")]
    [InlineData("unknown", "unknown")]
    [InlineData("Sev Critical", "critical")]
    [InlineData("HIGH vendor", "high")]
    [InlineData("Informative", "informational")]
    [InlineData("Not Applicable", "none")]
    [InlineData("Undetermined", "unknown")]
    [InlineData("Priority 0", "critical")]
    [InlineData("Priority-2", "medium")]
    [InlineData("N/A", "none")]
    [InlineData("custom-level", "custom-level")]
    public void Normalize_ReturnsExpectedCanonicalValue(string input, string expected)
    {
        var normalized = SeverityNormalization.Normalize(input);
        Assert.Equal(expected, normalized);
    }

    [Fact]
    public void Normalize_ReturnsNullWhenInputNullOrWhitespace()
    {
        Assert.Null(SeverityNormalization.Normalize(null));
        Assert.Null(SeverityNormalization.Normalize("   "));
    }
}
