public bool VerifyLoginUser(string userName, string password) { if (FieldsValidator.IsValidEmail(userName)) { this.UserName = userName; this.SuccessfulLogin = loginRequestService.ValidateLoginUser(userName, password); if (this.SuccessfulLogin) { this.ResultInfo = "Loggin was successful"; } else { this.ResultInfo = "An error was heppening, login faild"; } } else { this.ResultInfo = "Invalid email"; this.SuccessfulLogin = false; } return(this.SuccessfulLogin); }
public void VeryfyIsValidEmailFalseWithoutPoint() { bool expectedResult = FieldsValidator.IsValidEmail("a@a"); Assert.AreEqual(expectedResult, false); }
public void VeryfyIsValidEmailFalseOnlyText() { bool expectedResult = FieldsValidator.IsValidEmail("user"); Assert.AreEqual(expectedResult, false); }
public void VeryfyIsValidEmailTrue() { bool expectedResult = FieldsValidator.IsValidEmail("*****@*****.**"); Assert.AreEqual(expectedResult, true); }