using Kompas.Mcp.Core.Drawings;

namespace Kompas.Mcp.Tests;

[Trait("Category", "Unit")]
public sealed class PaperFormatsTests
{
    [Theory]
    [InlineData("A4", PaperFormat.A4)]
    [InlineData("a3", PaperFormat.A3)]
    [InlineData("  A2 ", PaperFormat.A2)]
    [InlineData("a0", PaperFormat.A0)]
    [InlineData("A1", PaperFormat.A1)]
    [InlineData("A5", PaperFormat.A5)]
    [InlineData("user", PaperFormat.User)]
    [InlineData("USER", PaperFormat.User)]
    public void Parse_maps_known(string value, PaperFormat expected)
        => Assert.Equal(expected, PaperFormats.Parse(value));

    [Fact]
    public void Parse_throws_on_unknown()
        => Assert.Throws<ArgumentException>(() => PaperFormats.Parse("A6"));

    [Fact]
    public void Parse_throws_on_null()
        => Assert.Throws<ArgumentNullException>(() => PaperFormats.Parse(null!));

    // ToKompas/FromKompas (↔ ksDocumentFormatEnum) — граница проекта, проверяются интеграцией.
}
