private void ExecuteLogin() { ASMRestSettingsInstance.Instance.HostAndPort = _textHostAndPort.Text; ASMRestSettingsInstance.Instance.UserName = _textUserName.Text; ASMRestSettingsInstance.Instance.Password = _textPassword.Text; try { BaseRestHttpClient client = new BaseRestHttpClient(ASMRestSettingsInstance.Instance); client.Login(); this.DialogResult = DialogResult.OK; this.Hide(); if (_checkRemember.Checked) { ASMLoginOptions options = new ASMLoginOptions(); options.Url = _textHostAndPort.Text; options.UserName = _textUserName.Text; options.Password = Encryptor.EncryptToString(_textPassword.Text); options.FullName = ASMRestSettingsInstance.Instance.FullName; options.Save(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void TestLogin() { InitSettings(); BaseRestHttpClient loginManager = new BaseRestHttpClient(ASMRestSettingsInstance.Instance); Assert.IsTrue(loginManager.Login()); }