Search in sources :

Example 1 with InstructorCourseJoinEmailWorkerAction

use of teammates.ui.automated.InstructorCourseJoinEmailWorkerAction in project teammates by TEAMMATES.

the class InstructorCourseJoinEmailWorkerActionTest method allTests.

@Test
public void allTests() {
    CourseAttributes course1 = dataBundle.courses.get("typicalCourse1");
    InstructorAttributes instr1InCourse1 = dataBundle.instructors.get("instructor1OfCourse1");
    AccountAttributes inviter = AccountsLogic.inst().getAccount("idOfInstructor2OfCourse1");
    String[] submissionParams = new String[] { ParamsNames.COURSE_ID, course1.getId(), ParamsNames.INSTRUCTOR_EMAIL, instr1InCourse1.email, ParamsNames.INVITER_ID, inviter.googleId };
    InstructorCourseJoinEmailWorkerAction action = getAction(submissionParams);
    action.execute();
    verifyNumberOfEmailsSent(action, 1);
    EmailWrapper email = action.getEmailSender().getEmailsSent().get(0);
    assertEquals(String.format(EmailType.INSTRUCTOR_COURSE_JOIN.getSubject(), course1.getName(), course1.getId()), email.getSubject());
    assertEquals(instr1InCourse1.email, email.getRecipient());
}
Also used : AccountAttributes(teammates.common.datatransfer.attributes.AccountAttributes) InstructorCourseJoinEmailWorkerAction(teammates.ui.automated.InstructorCourseJoinEmailWorkerAction) CourseAttributes(teammates.common.datatransfer.attributes.CourseAttributes) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) EmailWrapper(teammates.common.util.EmailWrapper) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)1 AccountAttributes (teammates.common.datatransfer.attributes.AccountAttributes)1 CourseAttributes (teammates.common.datatransfer.attributes.CourseAttributes)1 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)1 EmailWrapper (teammates.common.util.EmailWrapper)1 InstructorCourseJoinEmailWorkerAction (teammates.ui.automated.InstructorCourseJoinEmailWorkerAction)1