public void Login() { ManagerUsers manager = new ManagerUsers(); User user = new User("mushky9", "kkk", "0586191191", "lod", "02/02/1997", CodeOccupation.Customer); manager.AddUser(user); Assert.IsTrue(manager.Login("mushky9", "kkk").UserName == "mushky9"); }
private void EnterToLibary(object sender, RoutedEventArgs e) { if (nameBox.Text != "" && passwordBox.Password != "")// if all details are typed { User user = users.Login(nameBox.Text, passwordBox.Password); if (user != null)// if user is belong to ManagerUsers { UsingLibary page = new UsingLibary(user); this.Content = page; } else { MessageErrorLogin();// error for user which is not belong... } } else { MessageErrorMissingData(); // error for missing details } }