use of teammates.common.datatransfer.attributes.AccountAttributes in project teammates by TEAMMATES.
the class StudentProfileCreateFormUrlActionTest method testExecuteAndPostProcess.
@Override
@Test
public void testExecuteAndPostProcess() {
AccountAttributes student = typicalBundle.accounts.get("student1InCourse1");
testGenerateUploadUrlSuccessTypical(student);
testGenerateUploadUrlSuccessMasqueradeMode(student);
}
use of teammates.common.datatransfer.attributes.AccountAttributes in project teammates by TEAMMATES.
the class AccountAttributesTest method testBuilderWithPopulatedFieldValues.
@Test
public void testBuilderWithPopulatedFieldValues() {
String expectedGoogleId = "dummyGoogleId";
String expectedEmail = "email@example.com";
String expectedName = "dummyName";
String expectedInstitute = "dummyInstitute";
// since false case is covered in default test
boolean expectedIsInstructor = true;
Instant expectedCreatedAt = Instant.ofEpochMilli(98765);
AccountAttributes observedAccountAttributes = AccountAttributes.builder().withGoogleId(expectedGoogleId).withEmail(expectedEmail).withName(expectedName).withInstitute(expectedInstitute).withIsInstructor(expectedIsInstructor).withCreatedAt(expectedCreatedAt).withDefaultStudentProfileAttributes(expectedGoogleId).build();
assertEquals(expectedGoogleId, observedAccountAttributes.getGoogleId());
assertEquals(expectedEmail, observedAccountAttributes.getEmail());
assertEquals(expectedCreatedAt, observedAccountAttributes.createdAt);
assertEquals(expectedInstitute, observedAccountAttributes.getInstitute());
assertEquals(expectedIsInstructor, observedAccountAttributes.isInstructor());
assertEquals(expectedName, observedAccountAttributes.getName());
assertEquals(expectedGoogleId, observedAccountAttributes.studentProfile.googleId);
}
use of teammates.common.datatransfer.attributes.AccountAttributes in project teammates by TEAMMATES.
the class AccountAttributesTest method testBuilderWithUnsanitisedFieldValues.
@Test
public void testBuilderWithUnsanitisedFieldValues() {
AccountAttributes observedAccountAttributes = AccountAttributes.builder().withGoogleId("googleId@gmail.com").withName(" random name with extra spaces ").withEmail(" email@example.com ").withInstitute(" random institute name with extra spaces ").withStudentProfileAttributes(StudentProfileAttributes.builder("googleId@gmail.com").build()).build();
assertEquals("googleId", observedAccountAttributes.getGoogleId());
assertEquals("random name with extra spaces", observedAccountAttributes.getName());
assertEquals("email@example.com", observedAccountAttributes.getEmail());
assertEquals("random institute name with extra spaces", observedAccountAttributes.getInstitute());
assertEquals("googleId", observedAccountAttributes.studentProfile.googleId);
}
use of teammates.common.datatransfer.attributes.AccountAttributes in project teammates by TEAMMATES.
the class AccountAttributesTest method testToString.
@Test
public void testToString() {
AccountAttributes account = createValidAccountAttributesObject();
AccountAttributes account1 = createValidAccountAttributesObject();
AccountAttributes account2 = createInvalidAccountAttributesObject();
assertEquals(account.toString(), account1.toString());
assertFalse("different accounts have different toString() values", account1.toString().equals(account2.toString()));
}
use of teammates.common.datatransfer.attributes.AccountAttributes in project teammates by TEAMMATES.
the class AccountAttributesTest method testGetEntityTypeAsString.
@Test
public void testGetEntityTypeAsString() {
AccountAttributes account = createValidAccountAttributesObject();
assertEquals("Account", account.getEntityTypeAsString());
}
Aggregations