public void PasswordValidation_ValidLength_ReturnTrue()
        {
            ValidationServise service = new ValidationServise();
            bool result = service.PasswordValidation("login", new Label(), new Label(), 10);

            Assert.IsTrue(result);
        }
        public void PasswordValidation_LessLength_ReturnFalse()
        {
            ValidationServise service = new ValidationServise();
            bool result = service.PasswordValidation("a", new Label(), new Label(), 10);

            Assert.IsFalse(result);
        }
        public void PasswordValidation_MoreLength_ReturnFalse()
        {
            ValidationServise service = new ValidationServise();
            bool result = service.PasswordValidation("123456789012345678901", new Label(), new Label(), 10);

            Assert.IsFalse(result);
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            bool loginValid    = service.LoginValidation(loginTextBox.Text, errorLabel, emptyLoginLabel, loginTextBox.Width);
            bool passwordValid = service.PasswordValidation(passwordBox.Password, errorLabel, emptyPasswordLabel, loginTextBox.Width);
            bool canEnter      = service.СanEnter(loginTextBox.Text, passwordBox.Password, errorLabel, loginTextBox.Width);

            if (loginValid & passwordValid & canEnter)
            {
                NavigationService.Navigate(new AdminPage());
            }
        }