using System.Threading.Tasks;
using Xunit;

namespace StellaOps.Policy.Tests;

public sealed class PolicyScoringConfigTests
{
    [Fact]
    public void LoadDefaultReturnsConfig()
    {
        var config = PolicyScoringConfigBinder.LoadDefault();
        Assert.NotNull(config);
        Assert.Equal("1.0", config.Version);
        Assert.NotEmpty(config.SeverityWeights);
        Assert.True(config.SeverityWeights.ContainsKey(PolicySeverity.Critical));
        Assert.True(config.QuietPenalty > 0);
    }

    [Fact]
    public void BindRejectsEmptyContent()
    {
        var result = PolicyScoringConfigBinder.Bind(string.Empty, PolicyDocumentFormat.Json);
        Assert.False(result.Success);
        Assert.NotEmpty(result.Issues);
    }
}
