コード例 #1
0
 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);
 }
コード例 #2
0
        public void VeryfyIsValidEmailFalseWithoutPoint()
        {
            bool expectedResult = FieldsValidator.IsValidEmail("a@a");

            Assert.AreEqual(expectedResult, false);
        }
コード例 #3
0
        public void VeryfyIsValidEmailFalseOnlyText()
        {
            bool expectedResult = FieldsValidator.IsValidEmail("user");

            Assert.AreEqual(expectedResult, false);
        }
コード例 #4
0
        public void VeryfyIsValidEmailTrue()
        {
            bool expectedResult = FieldsValidator.IsValidEmail("*****@*****.**");

            Assert.AreEqual(expectedResult, true);
        }