Exemple #1
0
  public void testAsConfirmed() {
    assertTrue(UserStatus.CREATED.asConfirmed().isConfirmed());
    assertTrue(UserStatus.CONFIRMED.asConfirmed().isConfirmed());
    assertTrue(UserStatus.DISABLED.asConfirmed().isConfirmed());
    assertTrue(UserStatus.DISABLED2.asConfirmed().isConfirmed());

    assertFalse(UserStatus.CREATED.asConfirmed().isDisabled());
    assertFalse(UserStatus.CONFIRMED.asConfirmed().isDisabled());
    assertTrue(UserStatus.DISABLED.asConfirmed().isDisabled());
    assertTrue(UserStatus.DISABLED2.asConfirmed().isDisabled());
  }
Exemple #2
0
  public void testGetFromString() {
    assertTrue(UserStatus.getFromString(UserStatus.CREATED.asString()).equals(UserStatus.CREATED));
    assertTrue(
        UserStatus.getFromString(UserStatus.CONFIRMED.asString()).equals(UserStatus.CONFIRMED));
    assertTrue(
        UserStatus.getFromString(UserStatus.DISABLED.asString()).equals(UserStatus.DISABLED));

    // DISABLED2.asString() -> DISABLED.asString()
    assertTrue(
        UserStatus.getFromString(UserStatus.DISABLED2.asString()).equals(UserStatus.DISABLED));
  }
Exemple #3
0
 public void testIsDisabled() {
   assertFalse(UserStatus.CREATED.isDisabled());
   assertFalse(UserStatus.CONFIRMED.isDisabled());
   assertTrue(UserStatus.DISABLED.isDisabled());
   assertTrue(UserStatus.DISABLED2.isDisabled());
 }
Exemple #4
0
 public void testGetFromInt() {
   assertTrue(UserStatus.getFromInt(UserStatus.CREATED.asInt()) == UserStatus.CREATED);
   assertTrue(UserStatus.getFromInt(UserStatus.CONFIRMED.asInt()) == UserStatus.CONFIRMED);
   assertTrue(UserStatus.getFromInt(UserStatus.DISABLED.asInt()) == UserStatus.DISABLED);
   assertTrue(UserStatus.getFromInt(UserStatus.DISABLED2.asInt()) == UserStatus.DISABLED2);
 }