public void JsonSignUpObjectToJsonTest() { TemplateJson tl = new JsonSignUp(); var json = tl.GetJson(new SignUp(email, password, reEnteredEmail, reEnteredPassword, phone, firstName, lastName)); Assert.AreEqual(correctJson, json); }
public void JsonSignUpJsonToObjectTest() { TemplateJson tl = new JsonSignUp(); var o = tl.GetObject(correctJson) as SignUp; Assert.AreEqual(email, o.GetEmail()); Assert.AreEqual(password, o.GetPassword()); Assert.AreEqual(reEnteredPassword, o.GetReEnterPassword()); Assert.AreEqual(reEnteredEmail, o.GetReEnterEmail()); Assert.AreEqual(phone, o.GetPhone()); Assert.AreEqual(firstName, o.GetFirstName()); Assert.AreEqual(lastName, o.GetLastName()); }
public void JsonSignUpObjectToJsonInvalidTest() { bool exception = false; TemplateJson tl = new JsonSignUp(); try { var json = tl.GetJson("I am the wrong object"); } catch (InvalidLoginObjectException) { exception = true; } Assert.IsTrue(exception); }
public void JsonSignUpJsonToObjectInvalidTest() { bool exception = false; var incorrect = "{\"emails\":\"[email protected]\",\"password\":\"Password\"}"; TemplateJson tl = new JsonSignUp(); try { var o = tl.GetObject(incorrect) as SignUp; } catch (InvalidLoginJsonException) { exception = true; } Assert.IsTrue(exception); }
protected override void ThreadMethod() { try { var jsonData = new JsonSignUp().GetJson(information); var response = PostHttpRequest(new HttpPostSignUp(), jsonData); if (response.StatusCode == HttpStatusCode.OK) { ThreadComplete(true); } else { ThreadComplete(false); } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.StackTrace); ThreadComplete(false); } }