Example #1
0
        public void InsertData()
        {
            bool result = bllUser.Insert(new ModelUser()
            {
                Email       = RandomData.GetString(RandomData.GetInt(5, 10)),
                TelePhone   = RandomData.GetString(CommonData.ASCII_Number(), 12),
                MobilePhone = RandomData.GetString(CommonData.ASCII_Number(), 11),
                NickName    = RandomData.GetString(CommonData.ASCII_UpperEnglish(), RandomData.GetInt(5, 16)),
                Password    = RandomData.GetString(30),
                RealName    = RandomData.GetChineseString(RandomData.GetInt(2, 4)),
                Remark      = RandomData.GetString(RandomData.GetInt(10, 81)),
                Sex         = RandomData.Item(ConvertTool.EnumForeachArray <ModelUser.SexEnum>()),
                TimeAdd     = RandomData.GetDateTime(),
            });

            Print.WriteLine(result);
        }
        private CaseModel ExeEvent_Random_Select_Item()
        {
            return(new CaseModel()
            {
                NameSign = @"随机选项",
                ExeEvent = () => {
                    TestEnum[] source = ConvertTool.EnumForeachArray <TestEnum>();
                    foreach (TestEnum item in source)
                    {
                        Print.WriteLine(string.Format("Name: {0}  Value: {1}", item.GetName(), item.GetIntValue()));
                    }

                    Print.WriteLine("随机筛选的值: ");
                    TestEnum random_selitem = RandomData.Item(source);
                    Print.WriteLine(string.Format("Name: {0}  Value: {1}", random_selitem.GetName(), random_selitem.GetIntValue()));
                },
            });
        }
Example #3
0
        public void InsertData()
        {
            int  id     = 0;
            bool result = bllUser.Insert(new ModelUser()
            {
                Email       = RandomData.GetString(10),
                TelePhone   = RandomData.GetString(CommonData.ASCII_Number(), 12),
                MobilePhone = RandomData.GetString(CommonData.ASCII_Number(), 11),
                NickName    = RandomData.GetString(CommonData.ASCII_UpperEnglish(), 30),
                Password    = RandomData.GetString(100),
                RealName    = RandomData.GetString(CommonData.ASCII_UpperEnglish(), 10),
                Remark      = RandomData.GetString(200),
                Sex         = RandomData.Item(ConvertTool.EnumForeachArray <ModelUser.SexEnum>()),
                TimeAdd     = RandomData.GetDateTime(),
            }, out id);

            Print.WriteLine(result);
            Print.WriteLine(id);
        }