Exemplo n.º 1
0
        //#region Omit leading zero option is unchecked

        public string OmitZeroUnchecked(string number)
        {
            var numberVerifierSettings = OmitZeroSettings.OmitZeroUncheckedAndAllowLocalization();

            numberVerifierSettings.Setup(s => s.SourceDecimalPeriod).Returns(true);
            var methodsMock = new Mock <INumberVerifierMethods>(MockBehavior.Strict);

            NumberVerifierLocalizationsSettings.InitSeparators(numberVerifierSettings);

            _numberValidator.Verify(number, null, numberVerifierSettings.Object, out var normalizedNumbers, out _);

            methodsMock.Verify(m => m.OmitZero(number), Times.Never);
            return(normalizedNumbers.Texts[0].Normalized);
        }
Exemplo n.º 2
0
        public string OmitZeroUnchecked(string number)
        {
            var numberVerifierSettings = OmitZeroSettings.OmitZeroUncheckedAndAllowLocalization();
            var methodsMock            = new Mock <INumberVerifierMethods>(MockBehavior.Strict);

            NumberVerifierLocalizationsSettings.InitSeparators(numberVerifierSettings);
            var numberVerifierMain = new NumberVerifierMain(numberVerifierSettings.Object);

            numberVerifierMain.NormalizeAlphanumerics(number, new List <string>(), new List <string>(), ".", ".", false, numberVerifierSettings.Object.SourceOmitLeadingZero);
            var normalizedNumber = numberVerifierMain.NormalizedNumber(number, ".", ".", false);

            methodsMock.Verify(m => m.OmitZero(number), Times.Never);
            return(normalizedNumber);
        }
Exemplo n.º 3
0
        public string OmitZeroUnchecked(string number)
        {
            var numberVerifierSettings = OmitZeroSettings.OmitZeroUncheckedAndAllowLocalization();
            var methodsMock            = new Mock <INumberVerifierMethods>(MockBehavior.Strict);

            NumberVerifierLocalizationsSettings.InitSeparators(numberVerifierSettings);
            var numberVerifierMain = new NumberVerifierMain(numberVerifierSettings.Object);
            var normalizeNumber    = NumberVerifierSetup.GetNormalizedNumber(number, ".", ".", false, numberVerifierSettings.Object.SourceOmitLeadingZero);

            numberVerifierMain.NormalizeNumbers(normalizeNumber);
            var normalizedNumber = numberVerifierMain.NormalizeNumber(new SeparatorModel
            {
                MatchValue         = number,
                ThousandSeparators = ".",
                DecimalSeparators  = ".",
                NoSeparator        = false,
                CustomSeparators   = string.Empty
            });

            methodsMock.Verify(m => m.OmitZero(number), Times.Never);
            return(normalizedNumber);
        }