public async Task LoginAsyncIsLoginCodeOk() { LoginModelView loginModelView = new LoginModelView() { Email = "*****@*****.**", Password = "******", }; var result = await HttpRestClient.LoginAsync(loginModelView); Assert.AreEqual(result.Code, HttpStatusCode.OK); }
private async void LoginButton_Click(object sender, System.EventArgs e) { LoginModelView login = new LoginModelView() { Email = LogincomboBox.Text, Password = PasswordcomboBox.Text, }; AuthorizationResult = await HttpRestClient.LoginAsync(login); if (AuthorizationResult.Code == HttpStatusCode.OK) { this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("Błędny login lub hasło"); } }