示例#1
0
 private static HtmlDocument Login(BrowserSession session)
 {
     session.Get(SessionConfig.Urls.Login);
     session.FormElements[SessionConfig.FormElements.LoginEmail] = SessionConfig.FormInput.AdminUsername;
     session.FormElements[SessionConfig.FormElements.LoginPassword] = SessionConfig.FormInput.AdminPassword;
     return session.Post(SessionConfig.Urls.Login);
 }
示例#2
0
        private static HtmlDocument AddUserAccount(BrowserSession session, HtmlDocument response, UserAccount user)
        {
            var token = GetRequestVerificationToken(response);
            if (!String.IsNullOrEmpty(token))
            {
                session.FormElements[SessionConfig.Headers.RequestVerificationToken] = token;
                session.FormElements[SessionConfig.FormElements.Email] = user.Email;
                session.FormElements[SessionConfig.FormElements.Password] = user.Password;
                session.FormElements[SessionConfig.FormElements.ConfirmPassword] = user.Password;

                return session.Post(SessionConfig.Urls.CreateUser);
            }
            return null;
        }