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

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

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

            Assert.IsFalse(result);
        }
Exemple #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());
            }
        }