CleanAndInternationaliseNumber() 공개 메소드

public CleanAndInternationaliseNumber ( string number ) : string
number string
리턴 string
        public void CountryCodeConfigSet_LeavesNumberLeadingDigitDoesntMatch()
        {
            var countryCodeReplacement = new CountryCodeReplacement { CountryCode = "+61", LeadingNumberToReplace = "0" };
            const string number = "+61400000";
            var cleanAndInternationaliseNumber = countryCodeReplacement.CleanAndInternationaliseNumber(number);

            Assert.That(cleanAndInternationaliseNumber, Is.EqualTo("+61400000"));
        }
        public void CountryCodeConfigNotSet_LeavesNumber()
        {
            var countryCodeReplacement = new CountryCodeReplacement();
            const string number = "+61400000";
            var cleanAndInternationaliseNumber = countryCodeReplacement.CleanAndInternationaliseNumber(number);

            Assert.That(cleanAndInternationaliseNumber, Is.EqualTo(number));
        }
        public TrickleSmsWithDefinedTimeBetweenEachMessage MapToTrickleSpacedByPeriod(CoordinatedSharedMessageModel model, CountryCodeReplacement countryCodeReplacement)
        {
            var tags = string.IsNullOrWhiteSpace(model.Tags) ? null : model.Tags.Split(',').ToList().Select(t => t.Trim()).ToList();

            var rawNumberList = model.Numbers.Split(',');
            var cleanedInternationalisedNumbers = rawNumberList.Select(number => countryCodeReplacement != null ? countryCodeReplacement.CleanAndInternationaliseNumber(number) : number.Trim()).ToList();

            return new TrickleSmsWithDefinedTimeBetweenEachMessage
            {
                Messages = cleanedInternationalisedNumbers.Select(n => new SmsData(n, model.Message)).ToList(),
                StartTimeUtc = model.StartTime.ToUniversalTime(),
                TimeSpacing = TimeSpan.FromSeconds(model.TimeSeparatorSeconds.Value),
                MetaData = new SmsMetaData { Tags = tags, Topic = model.Topic },
                ConfirmationEmail = model.ConfirmationEmail
            };
        }
 public List<string> GetCleanInternationalisedNumbers(CountryCodeReplacement countryCodeReplacement)
 {
     return Numbers.Split(new[] { ',', ';', ':' }).Select(number => countryCodeReplacement != null ? countryCodeReplacement.CleanAndInternationaliseNumber(number) : number.Trim()).ToList();
 }
 public TrickleSmsOverCalculatedIntervalsBetweenSetDates MapToTrickleOverPeriod(CoordinatedSharedMessageModel model, CountryCodeReplacement countryCodeReplacement)
 {
     var rawNumberList = model.Numbers.Split(',');
     var cleanedInternationalisedNumbers = rawNumberList.Select(number => countryCodeReplacement != null ? countryCodeReplacement.CleanAndInternationaliseNumber(number) : number.Trim()).ToList();
     var tags = string.IsNullOrWhiteSpace(model.Tags) ? null : model.Tags.Split(',').ToList().Select(t => t.Trim()).ToList();
     return new TrickleSmsOverCalculatedIntervalsBetweenSetDates
     {
         Duration = model.SendAllBy.Value.Subtract(model.StartTime),
         Messages = cleanedInternationalisedNumbers
             .Select(n => new SmsData(n, model.Message)).
             ToList(),
         StartTimeUtc = model.StartTime.ToUniversalTime(),
         MetaData = new SmsMetaData
         {
             Tags = tags,
             Topic = model.Topic
         },
         ConfirmationEmail = model.ConfirmationEmail
     };
 }