using Kompas.Mcp.Core.Validation;

namespace Kompas.Mcp.Tests;

/// <summary>Юнит-тесты расшифровки кодов ошибок построения (ErrorType3d). COM не требуется.</summary>
[Trait("Category", "Unit")]
public sealed class Error3dTests
{
    [Theory]
    [InlineData(123, "пересек")]
    [InlineData(130, "топологи")]
    [InlineData(144, "невозможн")]
    [InlineData(179, "контур")]
    [InlineData(185, "не найден")]
    public void Describe_contains_meaningful_text(int code, string fragment)
        => Assert.Contains(fragment, Errors3d.Describe(code), StringComparison.OrdinalIgnoreCase);

    [Fact]
    public void Unknown_code_falls_back_to_number()
        => Assert.Contains("777", Errors3d.Describe(777));

    [Fact]
    public void Zero_code_means_no_error()
        => Assert.True(Errors3d.IsOk(0) && !Errors3d.IsOk(144));
}
