Пример #1
0
        private void ExecuteSilently()
        {
            var username = UsernameBox.Text;
            var password = PasswordBox.Password;

            var rohlikovac = new Rohlikovac(username, password);
            rohlikovac.Run();

            Application.Current.Shutdown();
        }
Пример #2
0
 public void RunTest()
 {
     var login = GetCredentials();
     var rohlikovac = new Rohlikovac(login[0], login[1]);
     string result = rohlikovac.Run();
     if (result.Contains("error"))
     {
         Assert.Fail($"Failed to login to rohlik. Login used: {login[0]}");
     }
 }
Пример #3
0
        private async void RunButton_Click(object sender, RoutedEventArgs e)
        {
            var username = UsernameBox.Text;
            var password = PasswordBox.Password;

            if (!ValidateInput(username, password))
            {
                return;
            }

            if (CredentialCheckBox.IsChecked != null && (bool) CredentialCheckBox.IsChecked)
            {
                SaveCredentials();
            }

            var rohlikovac = new Rohlikovac(username, password);
            StatusLabel.Content = "Rohlikovac is running, please wait...";
            var result = await Task.Run(() => rohlikovac.Run());
            StatusLabel.Content = result;
        }