using Kompas.Mcp.Core.Modeling;

namespace Kompas.Mcp.Tests;

/// <summary>Разбор стороны тонкой стенки: значение приходит строкой из схемы инструмента.</summary>
[Trait("Category", "Unit")]
public sealed class ThinSidesTests
{
    [Theory]
    [InlineData("outward", ThinSide.Outward)]
    [InlineData(" OUT ", ThinSide.Outward)]
    [InlineData("", ThinSide.Outward)]
    [InlineData(null, ThinSide.Outward)]
    [InlineData("inward", ThinSide.Inward)]
    [InlineData("in", ThinSide.Inward)]
    [InlineData("both", ThinSide.Both)]
    [InlineData("middle", ThinSide.Both)]
    public void Known_values_and_aliases_are_recognized(string? value, ThinSide expected)
        => Assert.Equal(expected, ThinSides.Parse(value));

    [Fact]
    public void Unknown_value_lists_the_allowed_ones()
    {
        var ex = Assert.Throws<ArgumentException>(() => ThinSides.Parse("sideways"));

        Assert.Contains("sideways", ex.Message, StringComparison.Ordinal);
        Assert.Contains("outward", ex.Message, StringComparison.Ordinal);
    }
}
