Ejemplo n.º 1
0
        public static string GetStreetName()
        {
            switch (FakerRandom.Rand.Next(2))
            {
            case 0: return(Name.GetLastName() + " " + GetStreetSuffix());

            case 1: return(Name.GetFirstName() + " " + GetStreetSuffix());

            default: throw new ApplicationException();
            }
        }
Ejemplo n.º 2
0
        public static string GetCity()
        {
            var item = FakerRandom.Rand.Next(4);

            switch (item)
            {
            case 0: return(GetCityPrefix() + " " + Name.GetFirstName() + GetCitySuffix());

            case 1: return(GetCityPrefix() + " " + Name.GetFirstName());

            case 2: return(Name.GetFirstName() + GetCitySuffix());

            case 3: return(Name.GetLastName() + GetCitySuffix());

            default: throw new ApplicationException();
            }
        }
Ejemplo n.º 3
0
        public static string GetUserName(string name = null)
        {
            if (name != null)
            {
                string parts = name.Split(' ').Join(new[] { ".", "_" }.Rand());
                return(parts.ToLower());
            }
            else
            {
                switch (FakerRandom.Rand.Next(2))
                {
                case 0:
                    return(new Regex(@"\W").Replace(Name.GetFirstName(), "").ToLower());

                case 1:
                    var parts = new[] { Name.GetFirstName(), Name.GetLastName() }.Select(n => new Regex(@"\W").Replace(n, ""));
                    return(parts.Join(new[] { ".", "_" }.Rand()).ToLower());

                default: throw new ApplicationException();
                }
            }
        }