예제 #1
0
파일: Address.cs 프로젝트: HeToC/HDK
        public static string GetStreetName()
        {
            var Rand = FakerRandom.Rand;

            switch (Rand.Next(2))
            {
            case 0: return(PersonName.GetLastName() + " " + GetStreetSuffix());

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

            default: throw new Exception();
            }
        }
예제 #2
0
파일: Company.cs 프로젝트: HeToC/HDK
        public static string GetName()
        {
            var Rand = FakerRandom.Rand;

            switch (Rand.Next(3))
            {
            case 0: return(PersonName.GetLastName() + " " + GetSuffix());

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

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

            default: throw new Exception();
            }
        }
예제 #3
0
파일: Address.cs 프로젝트: HeToC/HDK
        public static string GetCity()
        {
            var Rand = FakerRandom.Rand;
            var item = Rand.Next(4);

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

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

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

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

            default: throw new Exception();
            }
        }
예제 #4
0
        public static string GetUserName(string name = null)
        {
            if (name != null)
            {
                string parts = name.Split(' ').Join(new[] { ".", "_" }.Rand());
                return(parts.ToLower());
            }
            else
            {
                var Rand = FakerRandom.Rand;
                switch (Rand.Next(2))
                {
                case 0:
                    return(new Regex(@"\W").Replace(PersonName.GetFirstName(), "").ToLower());

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

                default: throw new Exception();
                }
            }
        }