public void Logout_test() { String dummyPassword = "******"; Random rnd = new Random(); int appendix = rnd.Next(9); Chatroom chatroom = new Chatroom(); chatroom.Register("chend" + appendix, appendix, dummyPassword); chatroom.Login("chend" + appendix, appendix, dummyPassword); chatroom.LogOut(); Assert.IsNull(chatroom.GetLoggedInUser()); chatroom.Login("chend" + appendix, appendix, dummyPassword); chatroom.LogOut(); Assert.IsNull(chatroom.GetLoggedInUser()); chatroom.Login("chend" + appendix, appendix, dummyPassword); Assert.IsNotNull(chatroom.GetLoggedInUser()); }
private void Logout_Button_Click(object sender, RoutedEventArgs e) { chatroom.LogOut(); Logger.Instance.Info("log-out button pressed"); Login login_window = new Login(chatroom); login_window.Show(); this.Close(); }