Fakultas Ilmu Komputer UI

Commit dedb7e8f authored by saddamonpc's avatar saddamonpc
Browse files

Remove unneeded classes and Add Jerome's tests

parent b3cf240b
Pipeline #82656 passed with stage
in 1 minute and 24 seconds
package softeng.g4.appointment;
public class Reminder {
}
package softeng.g4.appointment;
public class RequestAppointment {
}
......@@ -8,6 +8,9 @@ import softeng.g4.cli.ListIO;
import softeng.g4.course.Course;
import softeng.g4.course.CourseList;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import static org.junit.jupiter.api.Assertions.*;
class StudentTest {
......@@ -41,20 +44,60 @@ class StudentTest {
@Test
void seeCalendar() {
ByteArrayOutputStream outContent = new ByteArrayOutputStream();
System.setOut(new PrintStream(outContent));
testTa.setSchedule("monday", "Busy", "07:00", "21:00");
testTa.setSchedule("tuesday", "Busy", "07:00", "21:00");
testTa.setSchedule("wednesday", "Busy", "07:00", "21:00");
testTa.setSchedule("thursday", "Busy", "07:00", "21:00");
testTa.setSchedule("friday", "Busy", "07:00", "21:00");
testTa.setSchedule("saturday", "Busy", "07:00", "21:00");
testTa.setSchedule("sunday", "Busy", "07:00", "21:00");
new TeachingAssistant("testTA", "Test TA", Long.valueOf("1"), userList);
testStudent.seeCalendar("testTa", userList);
String outContentEdit = outContent.toString().replaceAll("\n", "").replaceAll("\r", "");
String expectedOutput =
"Monday:" +
"Busy 07:00 - 21:00" +
"Tuesday:" +
"Busy 07:00 - 21:00" +
"Wednesday:" +
"Busy 07:00 - 21:00" +
"Thursday:" +
"Busy 07:00 - 21:00" +
"Friday:" +
"Busy 07:00 - 21:00" +
"Saturday:" +
"Busy 07:00 - 21:00" +
"Sunday:" +
"Busy 07:00 - 21:00";
assertEquals(expectedOutput, outContentEdit);
}
@Test
void getRole() {
}
@Test
void getUsername() {
testStudent = new Student("Kevin", "Kevin Kurn", Long.valueOf("987654321"), userList);
assertEquals(testStudent.getUsername(), "Kevin");
}
@Test
void testToString() {
testStudent = new Student("Jerome", "Jerome Emmanuel", Long.valueOf("123456789"), userList);
assertEquals(testStudent.toString(),"Jerome - Jerome Emmanuel");
}
@AfterEach
void finalTearDown() {
courseList = new CourseList();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment