Exemplo n.º 1
0
        public void SetCheckedTrueUpdatesCheckedState()
        {
            var cbRed = new Checkbox(driver.FindElement(By.Id("cbred")));

            Assert.IsFalse(cbRed.IsChecked);
            cbRed.SetChecked(true);
            Assert.IsTrue(cbRed.IsChecked);
        }
Exemplo n.º 2
0
        public void SetCheckedFalseUpdatesCheckedState()
        {
            var cbGreen = new Checkbox(driver.FindElement(By.Id("cbgreen")));

            Assert.IsTrue(cbGreen.IsChecked);
            cbGreen.SetChecked(false);
            Assert.IsFalse(cbGreen.IsChecked);
        }
Exemplo n.º 3
0
#pragma warning restore 0649

        public void Initialize()
        {
            maleCheckbox.AddOnSetCheckedListener((value) =>
            {
                if (value)
                {
                    femaleCheckbox.SetChecked(false);
                }
            });

            femaleCheckbox.AddOnSetCheckedListener((value) =>
            {
                if (value)
                {
                    maleCheckbox.SetChecked(false);
                }
            });

            registerButton.AddOnClickListener(() =>
            {
                if (string.IsNullOrEmpty(loginTextField.Text))
                {
                    logger.Warning("You must provide login.");

                    return;
                }

                if (string.IsNullOrEmpty(passwordTextField.Text))
                {
                    logger.Warning("You must provide password.");

                    return;
                }

                if (!passwordTextField.Equals(repeatPasswordTextField.Text))
                {
                    logger.Warning("Passwords must match.");

                    return;
                }

                Account account = new Account()
                {
                    Login    = loginTextField.Text,
                    Password = passwordTextField.Text
                };

                logger.Info($"Successfully registered with " +
                            $"login \"{ account.Login }\" and password \"{ account.Password }\".");
            });
        }