Beispiel #1
0
        public void TestLoginType()
        {
            LoginValidationRule loginVR     = new LoginValidationRule();
            CultureInfo         cultureInfo = new CultureInfo("ru-RU");

            Assert.IsInstanceOfType(loginVR.Validate("root", cultureInfo), typeof(ValidationResult));
        }
Beispiel #2
0
        public void TestBadLogin()
        {
            LoginValidationRule loginVR     = new LoginValidationRule();
            CultureInfo         cultureInfo = new CultureInfo("ru-RU");
            var actual   = loginVR.Validate("r", cultureInfo);
            var expected = new ValidationResult(true, null);

            Assert.AreNotEqual(expected, actual);
        }
Beispiel #3
0
        public bool Validate()
        {
            var validationResult = true;

            var emailValidation    = new EmailValidationRule();
            var loginValidation    = new LoginValidationRule();
            var passwordValidation = new PasswordValidationRule();

            validationResult &= emailValidation.Validate(Email, null).IsValid;
            validationResult &= loginValidation.Validate(Login, null).IsValid;
            validationResult &= passwordValidation.Validate(Password, null).IsValid;

            return(validationResult);
        }