public void SignInTest() { var accountSign = new AccountSign() { MobilePhone = string.Format("171{0}", new Random().Next(12345678, 98765432)), Password = string.Format("pwd{0}", new Random().Next(12345, 98765)) }; var entity = ApiTestBase.SignUp(accountSign); var responseResult = WebApiClient.HttpPost(ApiEnvironment.Account_SignIn_Endpoint, accountSign); Assert.AreEqual(HttpStatusCode.OK, responseResult.StatusCode); Console.WriteLine(responseResult.Content); var signResult = responseResult.Content.ConvertEntity <AccountSignResult>(); Assert.IsNotNull(signResult); Assert.AreEqual(SignStatus.Success, signResult.SignStatus); Assert.IsNotNull(signResult.Account); // Error password accountSign.Password += "000"; responseResult = WebApiClient.HttpPost(ApiEnvironment.Account_SignIn_Endpoint, accountSign); Assert.AreEqual(HttpStatusCode.OK, responseResult.StatusCode); signResult = responseResult.Content.ConvertEntity <AccountSignResult>(); Assert.IsNotNull(signResult); Assert.AreEqual(SignStatus.InvalidPassword, signResult.SignStatus); }
public void SignUpTest() { Console.WriteLine(ConfigurationManager.AppSettings["app:TestValidationCode"]); var entity = ApiTestBase.SignUp(); Assert.IsNotNull(entity); }
public void InviteSignUpTest() { Console.WriteLine(ConfigurationManager.AppSettings["app:TestValidationCode"]); var accountSign = new AccountSign() { MobilePhone = string.Format("199{0}", new Random().Next(12345678, 98765432)), Password = string.Format("pwd{0}", new Random().Next(12345678, 98765432)), InviteCode = string.Format("Invite-{0}", Guid.NewGuid().ToString("N")) }; var entity = ApiTestBase.SignUp(accountSign); Assert.IsNotNull(entity); }
public void ExistsMobilePhoneTest() { var accountSign = new AccountSign() { MobilePhone = string.Format("171{0}", new Random().Next(12345678, 98765432)), Password = string.Format("pwd{0}", new Random().Next(12345, 98765)) }; var responseResult = WebApiClient.HttpGet(ApiEnvironment.Account_ExistsMobilePhone_Endpoint + "?phone=" + accountSign.MobilePhone); if (HttpStatusCode.OK != responseResult.StatusCode) { Console.WriteLine(responseResult.Content); } Assert.AreEqual("false", responseResult.Content); ApiTestBase.SignUp(accountSign); responseResult = WebApiClient.HttpGet(ApiEnvironment.Account_ExistsMobilePhone_Endpoint + "?phone=" + accountSign.MobilePhone); if (HttpStatusCode.OK != responseResult.StatusCode) { Console.WriteLine(responseResult.Content); } Assert.AreEqual("true", responseResult.Content); }