示例#1
0
  @BeforeClass
  public static void setUp() throws InavlidAttributeException, DuplicateAttributeException {
    head = new DepartmentHead("Physics");
    head.addCatalogEntry("Introduction to 20th Century Physics", 1130);
    head.addCourse(1130, 7, Semester.SUMMER, 100, 30);

    School.getInstance().addBuilding("Olin Hall", "OL");
    Building building = School.getInstance().getBuilding("OL");
    building.addClassroom(107, 150);
    building.addClassroom(110, 20);
    building.addOffice(113, false);
  }
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((fT == null) ? 0 : fT.hashCode());
   result = prime * result + ((fSch == null) ? 0 : fSch.hashCode());
   return result;
 }
 @Override
 public boolean equals(final Object obj) {
   if (this == obj) return true;
   if (!(obj instanceof TeachersOfSchoolMatch)) { // this should be infrequent			
     if (obj == null) return false;
     if (!(obj instanceof IPatternMatch)) return false;
     IPatternMatch otherSig = (IPatternMatch) obj;
     if (!pattern().equals(otherSig.pattern())) return false;
     return Arrays.deepEquals(toArray(), otherSig.toArray());
   }
   TeachersOfSchoolMatch other = (TeachersOfSchoolMatch) obj;
   if (fT == null) {
     if (other.fT != null) return false;
   } else if (!fT.equals(other.fT)) return false;
   if (fSch == null) {
     if (other.fSch != null) return false;
   } else if (!fSch.equals(other.fSch)) return false;
   return true;
 }
示例#4
0
  /*
   * ADMIN19
   */
  @Test
  public void testCreateRequirementBin()
      throws InavlidAttributeException, InvalidAssignmentException, DuplicateAttributeException {
    School.getInstance()
        .addCatalogEntry("Computer Science", "Accelerated Introduction to Program Design", 1103);
    head.addBin("Physics");
    head.addToBin("Physics", "Computer Science", 1103);

    Bin bin = head.getBin("Physics");
    assertEquals("Physics", bin.getDepartment());
    assertEquals("Physics", bin.getDegree());

    List<CatalogEntry> binCourses = bin.getClasses();
    assertEquals(1, binCourses.size());
    CatalogEntry entry = binCourses.get(0);
    assertEquals("Computer Science", entry.getDepartment());
    assertEquals(1103, entry.getCourseNumber());
    assertEquals("Accelerated Introduction to Program Design", entry.getName());
  }
示例#5
0
文件: School.java 项目: nayzaa/School
 public static void main(String[] args) {
   School test = new School();
   test.process();
 }