Example #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();
            }
        }
Example #2
0
        public static string GetName()
        {
            switch (FakerRandom.Rand.Next(3))
            {
            case 0: return(Name.GetLastName() + " " + GetSuffix());

            case 1: return(Name.GetLastName() + "-" + Name.GetLastName());

            case 2: return(String.Format("{0}, {1} and {2}", Name.GetLastName(), Name.GetLastName(), Name.GetLastName()));

            default: throw new ApplicationException();
            }
        }
Example #3
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();
            }
        }
Example #4
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();
                }
            }
        }