using Kompas.Mcp.Core.Drawings;

namespace Kompas.Mcp.Tests;

[Trait("Category", "Unit")]
public sealed class ShelfDirectionsTests
{
    [Theory]
    [InlineData("auto", ShelfDirection.Auto)]
    [InlineData("right", ShelfDirection.Right)]
    [InlineData("left", ShelfDirection.Left)]
    [InlineData("up", ShelfDirection.Up)]
    [InlineData("down", ShelfDirection.Down)]
    [InlineData("  RIGHT ", ShelfDirection.Right)]
    [InlineData("авто", ShelfDirection.Auto)]
    [InlineData("вправо", ShelfDirection.Right)]
    [InlineData("влево", ShelfDirection.Left)]
    [InlineData("вверх", ShelfDirection.Up)]
    [InlineData("вниз", ShelfDirection.Down)]
    public void Parse_maps_known(string value, ShelfDirection expected)
        => Assert.Equal(expected, ShelfDirections.Parse(value));

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

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

    // ToKompas (→ ksShelfDirectionEnum) — граница проекта; для Auto бросает (проверяется косвенно).
}
