The address of %s is %s", karenV,
karenV.getInstructorAddress());
if (karenV.getInstructorAddress().equals("10 Hightop Lane, Barrie, L2S
1A6")) {
marks++;
} else {
failedTest.add("Test 12");
}
System.out.printf("%nYour total marks are now: %.0f/%.0f=%.1f%%", marks,
totalMarks, marks / totalMarks * 100);
/**Test
13
**/
System.out.printf("%n%n~~~~~~~Test 13: Change the Instructor address and
display the result (1 mark)~~~~~~~");
karenV.changeAddress("101 First Floor Ave.", "Utopia", "L3S 2A2");
System.out.printf("%nExpected output: The address of Karen Vader is 101
First Floor Ave., Utopia, L3S 2A2");
System.out.printf("%nActual output:
The address of %s is %s", karenV,
karenV.getInstructorAddress());
if (karenV.getInstructorAddress().equals("101 First Floor Ave., Utopia,
L3S 2A2")) {

marks++;
} else {
failedTest.add("Test 13");
}
System.out.printf("%nYour total marks are now: %.0f/%.0f=%.1f%%", marks,
totalMarks, marks / totalMarks * 100);
/**Test
14 **/
System.out.printf("%n%n~~~~~~~Test 14: Display the courses the
Instructor can teach (1 mark)~~~~~~~");
System.out.printf("%nExpected output: Karen Vader can teach the
following courses: not qualified to teach courses yet.");
System.out.printf("%nActual output:
%s can teach the following
courses: %s", karenV, karenV.listOfSubjectsCertifiedToTeach());
if (karenV.listOfSubjectsCertifiedToTeach().equals("not qualified to
teach courses yet.")) {
marks++;
} else {
failedTest.add("Test 14");
}
System.out.printf("%nYour total marks are now: %.0f/%.0f=%.1f%%", marks,
totalMarks, marks / totalMarks * 100);
/**Test
15 **/
System.out.printf("%n%n~~~~~~~Test 15: Add some courses for the
instructor to teach (1 mark)~~~~~~~");
karenV.addCourseToInstructorAbilities("COMP1008");
karenV.addCourseToInstructorAbilities("COMP2003");
System.out.printf("%nExpected output: Karen Vader can teach the
following courses: [COMP1008, COMP2003]");
System.out.printf("%nActual output:
%s can teach the following
courses: %s", karenV, karenV.listOfSubjectsCertifiedToTeach());
if (karenV.listOfSubjectsCertifiedToTeach().equals("[COMP1008,
COMP2003]")) {
marks++;
} else {
failedTest.add("Test 15");
}
System.out.printf("%nYour total marks are now: %.0f/%.0f=%.1f%%", marks,
totalMarks, marks / totalMarks * 100);
/**Test
16 **/
System.out.printf("%n%n~~~~~~~Test 16: Test if the canTeach() identifies
that an instructor cannot teach a course (1 mark) ~~~~~~~");
System.out.printf("%nExpected output: Karen Vader is certified to
teach \"COMP3002\": false");
System.out.printf("%nActual output:
%s is certified to
teach \"COMP3002\": %s", karenV, karenV.InstructorcanTeach("COMP3002"));
if (!karenV.InstructorcanTeach("COMP3002")) {
marks++;
} else {
failedTest.add("Test 16");
}
System.out.printf("%nYour total marks are now: %.0f/%.0f=%.1f%%", marks,
totalMarks, marks / totalMarks * 100);
/**Test
17 **/
System.out.printf("%n%n~~~~~~~Test 17: Test if the canTeach() identifies
that an instructor can teach a course (1 mark)~~~~~~~");
System.out.printf("%nExpected output: Karen Vader is certified to

teach \"COMP1008\": true");
System.out.printf("%nActual output:
%s is certified to
teach \"COMP1008\": %s", karenV, karenV.InstructorcanTeach("COMP1008"));
if (karenV.InstructorcanTeach("COMP1008")) {
marks++;
} else {
failedTest.add("Test 17");
}
System.out.printf("%nYour total marks are now: %.0f/%.0f=%.1f%%", marks,
totalMarks, marks / totalMarks * 100);
/**Test
18 **/
System.out.printf("%n%n~~~~~~~Test 18: Test if the same course can be
added more than once to an Instructor (1 mark)~~~~~~~");
karenV.addCourseToInstructorAbilities("COMP2003");
System.out.printf("%nExpected output: Karen Vader can teach the


You've reached the end of your free preview.
Want to read all 16 pages?
- Summer '19