use of teammates.common.datatransfer.attributes.StudentProfileAttributes in project teammates by TEAMMATES.
the class StudentProfileAttributesTest method testDefaultValueForGenderIfNullPassed.
@Test
public void testDefaultValueForGenderIfNullPassed() {
StudentProfileAttributes profileAttributes = StudentProfileAttributes.builder(VALID_GOOGLE_ID).withGender(null).build();
assertIsDefaultValues(profileAttributes);
}
use of teammates.common.datatransfer.attributes.StudentProfileAttributes in project teammates by TEAMMATES.
the class StudentProfileAttributesTest method testGetInvalidityInfoForValidProfileWithEmptyValues.
private void testGetInvalidityInfoForValidProfileWithEmptyValues() {
StudentProfileAttributes validProfile = profile.getCopy();
______TS("Typical case: valid profile with empty attributes");
validProfile.shortName = "";
validProfile.email = "";
validProfile.nationality = "";
validProfile.institute = "";
assertTrue("'validProfile' indicated as invalid", validProfile.isValid());
assertEquals(new ArrayList<String>(), validProfile.getInvalidityInfo());
}
use of teammates.common.datatransfer.attributes.StudentProfileAttributes in project teammates by TEAMMATES.
the class StudentProfileAttributesTest method testGetJsonString.
@Test
public void testGetJsonString() throws Exception {
StudentProfileAttributes spa = StudentProfileAttributes.valueOf(profile.toEntity());
spa.modifiedDate = TimeHelper.parseInstant("2015-05-21 8:34 AM +0000");
assertEquals("{\n \"googleId\": \"valid.googleId\",\n \"shortName\": \"shor\"," + "\n \"email\": \"valid@email.com\",\n \"institute\": \"institute\"," + "\n \"nationality\": \"Lebanese\",\n \"gender\": \"female\"," + "\n \"moreInfo\": \"moreInfo can have a lot more than this...\"," + "\n \"pictureKey\": \"profile Pic Key\"," + "\n \"modifiedDate\": \"2015-05-21T08:34:00Z\"\n}", spa.getJsonString());
}
use of teammates.common.datatransfer.attributes.StudentProfileAttributes in project teammates by TEAMMATES.
the class StudentProfileAttributesTest method testToString.
@Test
public void testToString() {
StudentProfileAttributes spa = StudentProfileAttributes.valueOf(profile.toEntity());
profile.modifiedDate = spa.modifiedDate;
// the toString must be unique to the values in the object
assertEquals(profile.toString(), spa.toString());
}
use of teammates.common.datatransfer.attributes.StudentProfileAttributes in project teammates by TEAMMATES.
the class StudentProfileAttributesTest method testToEntity.
@Override
@Test
public void testToEntity() {
StudentProfile expectedEntity = createStudentProfileFrom(profile);
StudentProfileAttributes testProfile = StudentProfileAttributes.valueOf(expectedEntity);
StudentProfile actualEntity = testProfile.toEntity();
assertEquals(expectedEntity.getShortName(), actualEntity.getShortName());
assertEquals(expectedEntity.getInstitute(), actualEntity.getInstitute());
assertEquals(expectedEntity.getEmail(), actualEntity.getEmail());
assertEquals(expectedEntity.getNationality(), actualEntity.getNationality());
assertEquals(expectedEntity.getGender(), actualEntity.getGender());
assertEquals(expectedEntity.getMoreInfo(), actualEntity.getMoreInfo());
assertEquals(expectedEntity.getModifiedDate().toString(), actualEntity.getModifiedDate().toString());
assertEquals(expectedEntity.getPictureKey(), actualEntity.getPictureKey());
}
Aggregations