Esempio n. 1
0
  @Test
  public void classRosterTestFindStudent() throws Exception {
    roster.loadRoster();
    Student thisStudent = roster.viewStudentInfo("studentId");

    assertEquals("firstName", thisStudent.getFirstName());
  }
Esempio n. 2
0
  @Test
  public void classRosterTestAddStudent() {
    Student newStudent = new Student("firstName", "lastName", "studentId", "cohort");

    roster.addStudent(newStudent.getStudentId(), newStudent);

    assertEquals(1, roster.countStudents());
  }
Esempio n. 3
0
  @Test
  public void classRosterListAllStudents() throws Exception {
    ArrayList<Student> allStudents;

    roster.loadRoster();
    allStudents = roster.listAllStudents();

    assertEquals(0, roster.countStudents());
  }
Esempio n. 4
0
  @Test
  public void classRosterTestSaveAndLoadRoster() throws Exception {
    Student newStudent = new Student("firstName", "lastName", "studentId", "cohort");

    roster.addStudent(newStudent.getStudentId(), newStudent);
    roster.saveRoster();
    roster.removeStudent("studentId");
    roster.loadRoster();

    assertEquals(1, roster.countStudents());
  }
Esempio n. 5
0
  @Test
  public void classRosterTestRemoveStudent() {
    roster.removeStudent("studentId");

    assertEquals(0, roster.countStudents());
  }
Esempio n. 6
0
  @Test
  public void classRosterTestLoadRoster() throws Exception {
    roster.loadRoster();

    assertEquals(1, roster.countStudents());
  }
Esempio n. 7
0
 @Test
 public void classRosterTestEmptyRoster() {
   assertEquals(0, roster.countStudents());
 }
Esempio n. 8
0
 @After
 public void tearDown() throws Exception {
   roster.saveRoster();
 }