Ejemplo n.º 1
0
        public object ColumnValue(ColumnDescription colDesc)
        {
            string format;
            object value = null;

            if (colDesc.format == null || colDesc.format == string.Empty)
            {
                format = ColumnDescription.DEFAULT_FORMAT_COMPANY;
            }
            else
            {
                format = colDesc.format;
            }
            format = format.Trim().ToLower();
            switch (format)
            {
            case "bs":
                value = Faker.Company.BS();
                break;

            case "catchphrase":
                value = Faker.Company.CatchPhrase();
                break;

            case "name":
                value = Faker.Company.Name();
                break;

            case "suffix":
                value = Faker.Company.Suffix();
                break;
            }
            return(value);
        }
Ejemplo n.º 2
0
        public object ColumnValue(ColumnDescription colDesc)
        {
            object value  = null;
            string Format = "{0:" + colDesc.format + "}";

            value = string.Format(Format, rand.NextDouble() * (colDesc.max - colDesc.min) + colDesc.min);
            return(value);
        }
Ejemplo n.º 3
0
        public object ColumnValue(ColumnDescription colDesc)
        {
            char[] chars = "$%#@!*abcdefghijklmnopqrstuvwxyz1234567890?;:ABCDEFGHIJKLMNOPQRSTUVWXYZ^&".ToCharArray();
            int    num   = rand.Next(0, 26); // Zero to 25
            char   let   = (char)('a' + num);

            return(let);
        }
Ejemplo n.º 4
0
        public object ColumnValue(ColumnDescription colDesc)
        {
            string format;
            object value = null;

            format = "{0:" + colDesc.format + "}";
            bool b = (int)Math.Round(rand.NextDouble(), 0) == 1 ? true : false;

            value = b.ToString(format);
            return(value);
        }
Ejemplo n.º 5
0
        public object ColumnValue(ColumnDescription colDesc)
        {
            string format;
            object value = null;

            if (colDesc.format == null || colDesc.format == string.Empty)
            {
                format = ColumnDescription.DEFAULT_FORMAT_DATE;
            }
            else
            {
                format = "{0:" + colDesc.format + "}";
            }
            value = string.Format(format, RandomDay());
            return(value);
        }
Ejemplo n.º 6
0
        public object ColumnValue(ColumnDescription colDesc)
        {
            string format;
            object value = null;

            if (colDesc.format == null || colDesc.format == string.Empty)
            {
                format = ColumnDescription.DEFAULT_FORMAT_INTERNET;
            }
            else
            {
                format = colDesc.format;
            }
            format = format.Trim().ToLower();
            switch (format)
            {
            case "domainname":
                value = Faker.Internet.DomainName();
                break;

            case "domainsuffix":
                value = Faker.Internet.DomainSuffix();
                break;

            case "domainword":
                value = Faker.Internet.DomainWord();
                break;

            case "email":
                value = Faker.Internet.Email();
                break;

            case "freeemail":
                value = Faker.Internet.FreeEmail();
                break;

            case "username":
                value = Faker.Internet.UserName();
                break;
            }
            return(value);
        }
Ejemplo n.º 7
0
        public object ColumnValue(ColumnDescription colDesc)
        {
            object value  = null;
            string format = string.Empty;

            if (colDesc.format == null || colDesc.format == string.Empty)
            {
                format = ColumnDescription.DEFAULT_FORMAT_STRING;
            }
            else
            {
                format = colDesc.format;
            }
            format = format.Trim().ToLower();
            string formatType  = format[0].ToString();
            int    formatCount = 0;

            if (format.Length == 1)
            {
                formatCount = 1;
            }
            else
            {
                formatCount = int.Parse(format.Replace(formatType, ""));
            }
            switch (formatType)
            {
            case "w":    //words
                value = string.Join(" ", Faker.Lorem.Words(formatCount));
                break;

            case "p":    //paragraphs
                value = string.Join(" ", Faker.Lorem.Paragraphs(formatCount));
                break;

            case "s":    //sentences
                value = string.Join(" ", Faker.Lorem.Sentences(formatCount));
                break;
            }
            return(value);
        }
Ejemplo n.º 8
0
        public object ColumnValue(ColumnDescription colDesc)
        {
            string format;
            object value = null;

            if (colDesc.format == null || colDesc.format == string.Empty)
            {
                format = ColumnDescription.DEFAULT_FORMAT_NAME;
            }
            else
            {
                format = colDesc.format;
            }
            format = format.Trim().ToLower();
            switch (format)
            {
            case "first":
                value = Faker.Name.First();
                break;

            case "last":
                value = Faker.Name.Last();
                break;

            case "standard":
                value = Faker.Name.FullName(Faker.NameFormats.Standard);
                break;

            case "withprefix":
                value = Faker.Name.FullName(Faker.NameFormats.WithPrefix);
                break;

            case "withsuffix":
                value = Faker.Name.FullName(Faker.NameFormats.WithSuffix);
                break;
            }
            return(value);
        }
Ejemplo n.º 9
0
        public object ColumnValue(ColumnDescription colDesc)
        {
            string format;
            object value = null;

            if (colDesc.format == null || colDesc.format == string.Empty)
            {
                format = ColumnDescription.DEFAULT_FORMAT_ADDRESS;
            }
            else
            {
                format = colDesc.format;
            }
            format = format.Trim().ToLower();
            switch (format)
            {
            case "city":
                value = Faker.Address.City();
                break;

            case "cityprefix":
                value = Faker.Address.CityPrefix();
                break;

            case "citysufix":
                value = Faker.Address.CitySufix();
                break;

            case "country":
                value = Faker.Address.Country();
                break;

            case "secondaryaddress":
                value = Faker.Address.SecondaryAddress();
                break;

            case "streetaddress":
                value = Faker.Address.StreetAddress();
                break;

            case "streetname":
                value = Faker.Address.StreetName();
                break;

            case "streetsuffix":
                value = Faker.Address.StreetSuffix();
                break;

            case "ukcountry":
                value = Faker.Address.UkCountry();
                break;

            case "ukcounty":
                value = Faker.Address.UkCounty();
                break;

            case "ukpostcode":
                value = Faker.Address.UkPostCode();
                break;

            case "usstate":
                value = Faker.Address.UsState();
                break;

            case "usstateabbr":
                value = Faker.Address.UsStateAbbr();
                break;

            case "zipcode":
                value = Faker.Address.ZipCode();
                break;
            }
            return(value);
        }
Ejemplo n.º 10
0
 public object ColumnValue(ColumnDescription colDesc)
 {
     return(Faker.Phone.Number());
 }