public NumberTexts OmitZeroChecked(string number)
        {
            var numberVerifierSettings = OmitZeroSettings.OmitZeroCheckedAndPreventLocalization();

            numberVerifierSettings.Setup(s => s.SourceDecimalPeriod).Returns(true);

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

            return(normalizedNumbers);
        }
示例#2
0
        public string OmitZeroChecked(string number)
        {
            var numberVerifierSettings = OmitZeroSettings.OmitZeroCheckedAndPreventLocalization();
            var methodsMock            = new Mock <INumberVerifierMethods>();

            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.Setup(x => x.OmitZero(number));
            //  methodsMock.Verify(x=>x.OmitZero(number));

            return(normalizedNumber);
        }
        public string OmitZeroChecked(string number)
        {
            var numberVerifierSettings = OmitZeroSettings.OmitZeroCheckedAndPreventLocalization();
            var methodsMock            = new Mock <INumberVerifierMethods>();

            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(new SeparatorModel
            {
                MatchValue         = number,
                ThousandSeparators = ".",
                DecimalSeparators  = ".",
                NoSeparator        = false,
                CustomSeparators   = string.Empty
            });

            methodsMock.Setup(x => x.OmitZero(number));
            return(normalizedNumber);
        }