public void ChangePasswordTest() { ChangeUserSettingsMessage x = new ChangeUserSettingsMessage(); ChangeUserSettingsMessage y = new ChangeUserSettingsMessage(x.getMessageString()); Assert.AreEqual(x.FirstName, y.FirstName); Assert.AreEqual(x.PassWord, y.PassWord); Assert.AreEqual(x.LastName, y.LastName); Assert.AreEqual(x.UserID, y.UserID); Assert.AreEqual(x.ReturnMessage, y.ReturnMessage); }
public string handleUserUpdate(string message) { string returnMessage = ""; messageSpecs.ChangeUserSettingsMessage userMessage = new messageSpecs.ChangeUserSettingsMessage(message); SqlDataReader dr = null; try { dr = mySql.getDataReader(string.Format("EXEC updateUser '{0}','{1}','{2}','{3}','{4}'", userMessage.EmailAddress, userMessage.FirstName, userMessage.LastName, encrypt(userMessage.PassWord), userMessage.UserID )); userMessage.Verified = true; } catch { } finally { if (dr != null) dr.Close(); } returnMessage = userMessage.getMessageString(); return returnMessage; }
public void ChangeSettings() { SocketHandler.SocketServer mySockets = new SocketHandler.SocketServer(0, 1000); SocketHandler.SocketClient clientSocket = null; mySockets.Init(); mySockets.Start(new System.Net.IPEndPoint(System.Net.IPAddress.Parse("127.0.0.1"), 20000)); clientSocket = new SocketHandler.SocketClient("127.0.0.1", 20000, false, ((char)2).ToString(), ((char)3).ToString()); messageSpecs.ChangeUserSettingsMessage message = new messageSpecs.ChangeUserSettingsMessage(); message.EmailAddress = "*****@*****.**"; message.UserID = "10006"; message.FirstName = "Cody"; message.LastName = "eidsness"; message.PassWord = "******"; clientSocket.Send(message.getMessageString()); for (int i = 1; i <= 5; i++) { System.Threading.Thread.Sleep(1000); while (clientSocket.messageQueue.Count > 0) { if (clientSocket.messageQueue.Dequeue().Substring(0, 5) == ChangeUserSettingsMessage.ChangeUserSettingsMessageType) return; } } Assert.Fail("Never got login message back"); }