Methods Summary |
---|
protected void | setUp()
this.user = new GDataAccount();
this.user.setName("simonW");
super.setUp();
|
protected void | tearDown()
super.tearDown();
|
public void | testEquals()
assertTrue(this.user.equals(this.user));
GDataAccount a = new GDataAccount();
a.setName(this.user.getName());
assertTrue(this.user.equals(a));
a.setName("someOtheraccount");
assertFalse(this.user.equals(a));
assertFalse(this.user.equals(null));
assertFalse(this.user.equals(new String()));
assertFalse(new GDataAccount().equals(new GDataAccount()));
|
public void | testGetRolesAsInt()
assertEquals(1,this.user.getRolesAsInt());
this.user.setRole(AccountRole.ENTRYAMINISTRATOR);
assertEquals(3,this.user.getRolesAsInt());
this.user.setRole(AccountRole.FEEDAMINISTRATOR);
assertEquals(7,this.user.getRolesAsInt());
this.user.setRole(AccountRole.USERADMINISTRATOR);
assertEquals(15,this.user.getRolesAsInt());
|
public void | testHashCode()
assertEquals(this.user.hashCode(),this.user.hashCode());
assertFalse(this.user.hashCode()== this.user.getName().hashCode());
GDataAccount a = new GDataAccount();
a.setName(this.user.getName());
assertEquals(this.user.hashCode(),a.hashCode());
a.setName(null);
assertFalse(a.hashCode()== this.user.hashCode());
|
public void | testIsUserInRole()
assertFalse(this.user.isUserInRole(null));
assertTrue(this.user.isUserInRole(AccountRole.USER));
assertFalse(this.user.isUserInRole(AccountRole.ENTRYAMINISTRATOR));
this.user.setRole(AccountRole.ENTRYAMINISTRATOR);
assertTrue(this.user.isUserInRole(AccountRole.ENTRYAMINISTRATOR));
|
public void | testIsUserInRoleInt()
assertFalse(GDataAccount.isInRole(1,AccountRole.ENTRYAMINISTRATOR));
assertFalse(GDataAccount.isInRole(1,AccountRole.FEEDAMINISTRATOR));
assertTrue(GDataAccount.isInRole(3,AccountRole.ENTRYAMINISTRATOR));
assertTrue(GDataAccount.isInRole(15,AccountRole.ENTRYAMINISTRATOR));
assertTrue(GDataAccount.isInRole(3,AccountRole.USER));
assertTrue(GDataAccount.isInRole(15,AccountRole.USERADMINISTRATOR));
assertFalse(GDataAccount.isInRole(7,AccountRole.USERADMINISTRATOR));
assertFalse(GDataAccount.isInRole(7,null));
|
public void | testReqValuesSet()
assertFalse(this.user.requiredValuesSet());
this.user.setPassword("hello");
assertFalse(this.user.requiredValuesSet());
this.user.setPassword("helloworld");
assertTrue(this.user.requiredValuesSet());
assertFalse(new GDataAccount().requiredValuesSet());
|
public void | testSetRolesAsInt()
this.user.setRolesAsInt(2);
this.user.setRolesAsInt(4);
this.user.setRolesAsInt(8);
assertEquals(4,this.user.getRoles().size());
this.user.setRolesAsInt(15);
assertEquals(4,this.user.getRoles().size());
this.user = new GDataAccount();
this.user.setName("simon");
this.user.setRolesAsInt(15);
assertEquals(4,this.user.getRoles().size());
|
public void | testToStringPrevNulPEx()
assertNotNull(this.user.toString());
|