using Kompas.Mcp.Core.Conversion;
namespace Kompas.Mcp.Tests;
/// Юнит-тесты маппинга формата STEP в коды конвертера КОМПАС. COM не требуется.
[Trait("Category", "Unit")]
public sealed class StepFormatTests
{
[Theory]
[InlineData(StepFormat.Auto, 3)] // ksConverterToSTEP
[InlineData(StepFormat.Ap203, 203)] // ksConverterToSTEP_AP203
[InlineData(StepFormat.Ap214, 214)] // ksConverterToSTEP_AP214
[InlineData(StepFormat.Ap242, 242)] // ksConverterToSTEP_AP242
public void Export_code_matches_converter_enum(StepFormat fmt, int expected)
=> Assert.Equal(expected, StepFormats.ExportConverterCode(fmt));
[Fact]
public void Import_code_is_ksConverterFromStep()
=> Assert.Equal(-3, StepFormats.ImportConverterCode);
[Theory]
[InlineData("auto", StepFormat.Auto)]
[InlineData("step", StepFormat.Auto)]
[InlineData("ap214", StepFormat.Ap214)]
[InlineData("214", StepFormat.Ap214)]
[InlineData("AP203", StepFormat.Ap203)]
[InlineData("ap242", StepFormat.Ap242)]
public void Parse_maps_known_strings(string input, StepFormat expected)
=> Assert.Equal(expected, StepFormats.Parse(input));
[Fact]
public void Parse_rejects_unknown_format()
=> Assert.Throws(() => StepFormats.Parse("iges"));
}