public void LogonMessageTest() { LogonMessage x = new LogonMessage(); LogonMessage y = new LogonMessage(x.getMessageString()); Assert.AreEqual(x.FirstName, y.FirstName); Assert.AreEqual(x.PassWord, y.PassWord); Assert.AreEqual(x.LastName, y.LastName); Assert.AreEqual(x.UserName, y.UserName); Assert.AreEqual(x.ReturnMessage, y.ReturnMessage); }
private void buttonSignIn_Click(object sender, EventArgs e) { messageSpecs.LogonMessage logonMessage = new messageSpecs.LogonMessage(); string errorMessage1, errorMessage2 = null; if (UserNameIsValid(textBoxUserName.Text.Trim(), out errorMessage1) && PasswordIsValid(textBoxPassword.Text.Trim(), out errorMessage2)) { logonMessage.UserName = textBoxUserName.Text.Trim(); logonMessage.PassWord = textBoxPassword.Text.Trim(); if (checkBoxRememberMe.Checked) { Properties.Settings.Default.UserName = textBoxUserName.Text.Trim(); Properties.Settings.Default.Password = textBoxPassword.Text.Trim(); Properties.Settings.Default.Save(); } myClient.Send(logonMessage.getMessageString()); } else if (string.IsNullOrEmpty(textBoxPassword.Text)) errorProviderPassword.SetError(this.textBoxPassword, errorMessage2); else errorProviderEmailID.SetError(this.textBoxUserName, errorMessage1); }