private List <FakeUser> CreateOneUser(int total)
        {
            var list = new List <FakeUser>();

            if (total < 1)
            {
                return(list);
            }
            for (int i = 0; i < total; i++)
            {
                var gender   = FakeUtility.CreateGender();
                var fakeUser = new FakeUser()
                {
                    Id           = FakeUtility.CreateGuid(),
                    RealName     = FakeUtility.CreatePersonName(gender),
                    Username     = FakeUtility.CreateUsername(),
                    Password     = FakeUtility.CreatePassword(),
                    Address      = "XXXX路yy号",
                    Mobile       = FakeUtility.CreateMobile(),
                    Email        = FakeUtility.CreateEmail(),
                    Points       = FakeUtility.RandomInt(0, 100),
                    Birthday     = FakeUtility.CreateBirthday(),
                    PersonHeight = FakeUtility.CreatePersonHeight(),
                    CreateTime   = DateTime.Now
                };

                list.Add(fakeUser);
            }
            return(list);
        }
Beispiel #2
0
 public static FakeUser Fake()
 {
     return(new FakeUser()
     {
         Id = Guid.NewGuid(),
         Username = FakeUtility.CreateUsername(6, 12),
         Password = FakeUtility.CreatePassword(6),
         RealName = FakeUtility.CreatePersonName(GenderType.None),
         Gender = (GenderType)FakeUtility.RandomInt(0, 2),
         Mobile = FakeUtility.CreateMobile(),
         Email = FakeUtility.CreateEmail(),
         Address = "测试地址",
         Points = FakeUtility.RandomInt(1, 200),
         PersonHeight = FakeUtility.CreatePersonHeight(),
         Birthday = FakeUtility.CreateBirthday(1980),
         CreateTime = DateTime.Now
     });
 }
        public void CreateMobileTest()
        {
            Stopwatch sw = new Stopwatch();

            sw.Start();
            var result = new List <string>();

            for (int i = 0; i < 100; i++)
            {
                var item = FakeUtility.CreateMobile();
                result.Add(item);
            }
            sw.Stop();
            Trace.WriteLine("耗时:" + sw.Elapsed);
            foreach (var item in result)
            {
                Trace.WriteLine(item);
            }
        }
        private FakeUser CreateOneUser()
        {
            var gender   = FakeUtility.CreateGender();
            var fakeUser = new FakeUser()
            {
                Id           = FakeUtility.CreateGuid(),
                RealName     = FakeUtility.CreatePersonName(gender),
                Username     = FakeUtility.CreateUsername(),
                Password     = FakeUtility.CreatePassword(),
                Address      = "XXXX路yy号",
                Mobile       = FakeUtility.CreateMobile(),
                Email        = FakeUtility.CreateEmail(),
                Points       = FakeUtility.RandomInt(0, 100),
                Birthday     = FakeUtility.CreateBirthday(),
                PersonHeight = FakeUtility.CreatePersonHeight(),
                CreateTime   = DateTime.Now
            };

            return(fakeUser);
        }