using Meezi.Core.Utilities;
using Xunit;

namespace Meezi.API.Tests;

public class OtpNormalizerTests
{
    [Theory]
    [InlineData("916581", "916581")]
    [InlineData(" 916581 ", "916581")]
    [InlineData("۹۱۶۵۸۱", "916581")]
    [InlineData("٩١٦٥٨١", "916581")]
    public void Normalize_maps_to_ascii_digits(string input, string expected)
    {
        Assert.Equal(expected, OtpNormalizer.Normalize(input));
        Assert.True(OtpNormalizer.IsValidSixDigitCode(input));
    }

    [Theory]
    [InlineData("")]
    [InlineData("12345")]
    [InlineData("1234567")]
    public void IsValid_rejects_invalid(string input)
    {
        Assert.False(OtpNormalizer.IsValidSixDigitCode(input));
    }
}
