示例#1
0
        protected UserInfo CreateUserWithVerifiedEmailAddress(string email, string password)
        {
            SnCore.WebServices.WebAccountService.WebAccountService endpoint = new SnCore.WebServices.WebAccountService.WebAccountService();

            UserInfo result = new UserInfo();

            result.email    = email;
            result.password = password;

            result.id = CreateUser(email, password);
            Assert.IsTrue(result.id > 0);

            result.ticket = Login(email, password);
            Assert.IsNotEmpty(result.ticket);

            Assert.IsFalse(endpoint.HasVerifiedEmail(result.ticket, result.id));
            SnCore.WebServices.WebAccountService.TransitAccountEmailConfirmation[] confirmations = endpoint.GetAccountEmailConfirmations(
                GetAdminTicket(), result.id, null);

            string verifiedemail = endpoint.VerifyAccountEmail(
                confirmations[0].Id, confirmations[0].Code);

            Console.WriteLine("Verified: {0}", verifiedemail);
            Assert.AreEqual(verifiedemail, result.email);
            Assert.IsTrue(endpoint.HasVerifiedEmail(result.ticket, result.id));

            return(result);
        }
示例#2
0
        protected int CreateUser(string email, string password, DateTime dateofbirth)
        {
            SnCore.WebServices.WebAccountService.TransitAccount t_instance = new SnCore.WebServices.WebAccountService.TransitAccount();
            t_instance.Name     = GetNewString();
            t_instance.Password = password;
            t_instance.Birthday = dateofbirth;
            SnCore.WebServices.WebAccountService.WebAccountService account_endpoint = new SnCore.WebServices.WebAccountService.WebAccountService();
            int id = account_endpoint.CreateAccount(string.Empty, email, t_instance);

            Console.WriteLine("Created user: {0}", id);
            Assert.IsTrue(id > 0);
            return(id);
        }
示例#3
0
 public string GetAdminTicket()
 {
     SnCore.WebServices.WebAccountService.WebAccountService endpoint = new SnCore.WebServices.WebAccountService.WebAccountService();
     return(endpoint.Login("*****@*****.**", "password"));
 }
示例#4
0
 public SnCore.WebServices.WebAccountService.TransitAccount GetAdminAccount()
 {
     SnCore.WebServices.WebAccountService.WebAccountService endpoint = new SnCore.WebServices.WebAccountService.WebAccountService();
     return(endpoint.GetAccount(GetAdminTicket(), true));
 }
示例#5
0
 public string Login(string email, string password)
 {
     SnCore.WebServices.WebAccountService.WebAccountService endpoint = new SnCore.WebServices.WebAccountService.WebAccountService();
     return(endpoint.Login(email, password));
 }
示例#6
0
 protected void DeleteUser(int id)
 {
     SnCore.WebServices.WebAccountService.WebAccountService account_endpoint = new SnCore.WebServices.WebAccountService.WebAccountService();
     account_endpoint.DeleteAccount(GetAdminTicket(), id);
 }