Inheritance: DialogViewModel
        public void ValidatesLoginAndPassword()
        {
            var viewModel = new CredentialsViewModel();
            Assert.IsFalse(viewModel.LoginValidator.ValidationResult.IsValid);
            Assert.IsFalse(viewModel.PasswordValidator.ValidationResult.IsValid);

            viewModel.Login = "******";
            viewModel.Password = "******";

            Assert.IsTrue(viewModel.LoginValidator.ValidationResult.IsValid);
            Assert.IsTrue(viewModel.PasswordValidator.ValidationResult.IsValid);
        }
        public static bool CredentialModalPrompt(TargetUri targetUri, out string username, out string password)
        {
            var credentialViewModel = new CredentialsViewModel();

            Git.Trace.WriteLine($"prompting user for credentials for '{targetUri}'.");

            bool credentialValid = ShowViewModel(credentialViewModel, () => new CredentialsWindow());

            username = credentialViewModel.Login;
            password = credentialViewModel.Password;

            return credentialValid;
        }
        public void IsValidWhenBothLoginAndPasswordIsValid()
        {
            var viewModel = new CredentialsViewModel();
            Assert.IsFalse(viewModel.ModelValidator.IsValid);
            viewModel.Login = "******";
            Assert.IsFalse(viewModel.ModelValidator.IsValid);

            viewModel.Password = "******";

            Assert.IsTrue(viewModel.ModelValidator.IsValid);

            viewModel.Login = "";

            Assert.IsFalse(viewModel.ModelValidator.IsValid);
        }