using Kbx.Contracts.Generated;
using Xunit;

namespace Kbx.Contracts.Tests;

public sealed class KbxFieldCatalogTests
{
    [Fact]
    public void Sensitive_fields_have_masking_metadata()
    {
        var invalid = KbxFieldCatalog.All.Where(x => x.Sensitive && string.IsNullOrWhiteSpace(x.Masking)).ToArray();
        Assert.Empty(invalid);
    }

    [Fact]
    public void Order_quantity_is_canonical()
    {
        var field = KbxFieldCatalog.Get(KbxFieldKeys.OrderQty);
        Assert.Equal("quantity", field.DataType);
        Assert.True(field.Importable);
    }
}
