Пример #1
0
        public void CountyNamecrubberTest()
        {
            var code = ScrubCountyCode.ScrubCountyName();

            Assert.NotNull(code);
            Assert.IsType <string>(code);
        }
Пример #2
0
        public void CountyFIPSScrubberTest()
        {
            var code = ScrubCountyCode.ScrubCountyFIPS();

            Int32.TryParse(code, out int result);

            Assert.NotNull(code);
            Assert.True(result > 0);
        }
Пример #3
0
        /// <summary>
        /// Routes String by scrubbing types
        /// </summary>
        /// <param name="property"></param>
        /// <param name="cleanDataInstance"></param>
        /// <param name="scrubType"></param>
        /// <returns></returns>
        private object RouteStringType()
        {
            var scrubber = _currentProperty.GetCustomAttribute(typeof(ScrubString));

            if (scrubber != null)
            {
                ScrubString    atr           = scrubber as ScrubString;
                StringScrubber attrScrubType = atr.scrubber;
                bool           IsRedacted    = atr.IsRedacted;

                if (IsRedacted)
                {
                    return("*** REDACTED ***");
                }

                switch (attrScrubType)
                {
                case StringScrubber.SSN:
                    return(ScrubBasicTypes.ScrubSSN());

                case StringScrubber.Phone:
                    return(Faker.Phone.Number());

                case StringScrubber.Email:
                    return(Faker.Internet.Email());

                case StringScrubber.Address:
                    return(Faker.Address.StreetAddress());

                case StringScrubber.AddressTwo:
                    return(Faker.Address.SecondaryAddress());

                case StringScrubber.City:
                    return(Faker.Address.City());

                case StringScrubber.State:
                    return(Faker.Address.UsState());

                case StringScrubber.CountyFIPS:
                    return(ScrubCountyCode.ScrubCountyFIPS());

                case StringScrubber.CountyName:
                    return(ScrubCountyCode.ScrubCountyName());

                case StringScrubber.StateCode:
                    return(Faker.Address.UsStateAbbr());

                case StringScrubber.Zip:
                    return(Faker.Address.ZipCode());

                case StringScrubber.FullName:
                    return(Faker.Name.FullName());

                case StringScrubber.FirstName:
                    return(Faker.Name.First());

                case StringScrubber.LastName:
                    return(Faker.Name.Last());

                case StringScrubber.MiddleName:
                    //Two First Names
                    return(Faker.Name.First());

                case StringScrubber.UserName:
                    return(Faker.Internet.UserName());

                case StringScrubber.Number:
                    var minValue = atr.minValue;
                    var maxValue = atr.maxValue;
                    return(Faker.RandomNumber.Next(minValue, maxValue));

                case StringScrubber.VIN:
                    return(ScrubBasicTypes.ScrubVIN());

                default:
                    return(RouteGenericText(atr.length));
                }
            }
            else
            {
                return(Faker.Lorem.Sentence(144));
            }
        }