Ejemplo n.º 1
0
 public User GetTestUser(string email = null)
 {
     email = string.IsNullOrEmpty(email) ? "*****@*****.**" : email;
     string password = PasswordGenerator.GenerateRandomPassword();
     string hashPwd = HashGenerator.GenerateHash(password);
     const string firstName = "TestFName";
     const string lastName = "TestLName";
     string mobile = RandomGenerator.GenerateRandomNumberString(10);
     string mobileCode = "123456"; //VerificationCodeGenerator.GenerateNewVerificationCode();
     string socialAccountId = RandomGenerator.GenerateRandomNumberString(10);
     string emailCode = VerificationCodeGenerator.GenerateNewVerificationCode();
     const string socialAccountType = "Facebook";
     var testUser = new User
                        {
                            Email = email,
                            Password = password,
                            HashPassword = hashPwd,
                            FirstName = firstName,
                            LastName = lastName,
                            Mobile = mobile,
                            MobileCode = mobileCode,
                            SocialAccountId = socialAccountId,
                            SocialAccountType = socialAccountType,
                            EmailCode = emailCode
                        };
     return testUser;
 }
Ejemplo n.º 2
0
 internal static void SetTestUser(this TestContext testContext, User user)
 {
     testContext.Properties.Add("TestUser", user);
 }
Ejemplo n.º 3
0
 public void Initialize()
 {
     LoginService = new LoginService();
     TestUser = TestContextManager.GetTestUser();
 }