コード例 #1
0
 @Test
 public void stringToUserStatusShouldReturnCorrectStatusBasedOnInputString() {
   assertEquals(UserStatus.ACTIVE, UserStatus.stringToUserStatus(active));
   assertEquals(UserStatus.LOCKED, UserStatus.stringToUserStatus(locked));
   assertEquals(UserStatus.BANNED, UserStatus.stringToUserStatus(banned));
 }
コード例 #2
0
 @Test
 public void stringToUserStatusShoudReturnActiveForIncorrectInputs() {
   assertEquals(UserStatus.ACTIVE, UserStatus.stringToUserStatus("aefwe"));
   assertEquals(UserStatus.ACTIVE, UserStatus.stringToUserStatus("  Active "));
 }
コード例 #3
0
 @Test
 public void stringToUserStatusShouldReturnActiveForNullOrEmptyString() {
   assertEquals(UserStatus.ACTIVE, UserStatus.stringToUserStatus(new String()));
   assertEquals(UserStatus.ACTIVE, UserStatus.stringToUserStatus(""));
 }