Beispiel #1
0
 @Test
 public void testIsEnabled() {
   String usernameTrue = "MikeyBP"; // valid
   String usernameFalse = "Krieger"; // invalid
   assertTrue("UserHelper.isAdmin should return 'true'", UserHelper.isEnabled(usernameTrue));
   assertFalse("UserHelper.isAdmin should return 'false'", UserHelper.isEnabled(usernameFalse));
 }
Beispiel #2
0
 @Test
 public void testLogin() {
   String username = "******"; // valid username
   String password = "******"; // valid password
   String usernameFalse = "MikeyBad"; // invalid username
   String passwordFalse = "crupples"; // invalid password
   // UserHelper.login(username, password)
   assertTrue("UserHelper.login should return 'true'", UserHelper.login(username, password));
   assertFalse(
       "UserHelper.login should return 'false'", UserHelper.login(usernameFalse, passwordFalse));
 }
Beispiel #3
0
 // This test is not complete
 @Test
 public void testGetUser() {
   int userId = 1;
   assertEquals(
       "UserHelper.getUser should return 'MikeyBP'", "MikeyBP", UserHelper.getUser(userId));
 }