public void testAddCourseName() { String courseCode = "COMP1011"; instructor.addCourseName(courseCode); assertEquals(courseCode, instructor.subjectIllgibleToTeach()); }
public void testSubjectIllgibleToTeach() { String expResult = "COMP1011, COMP1008"; instructor.addCourseName("COMP1011"); instructor.addCourseName("COMP1008"); String result = instructor.subjectIllgibleToTeach(); assertEquals(expResult, result); }
if(courseCode.isEmpty()) throw new IllegalArgumentException("Course code cannot be empty."); else courses.add(courseCode);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)