コード例 #1
0
  @Test
  public void canDetectConcimittingCoursesConflicts() {
    List<Conflict> conflicts = filter.run(scheduleMock);

    assertEquals(1, conflicts.size());
    verify(aSectionMock).areConcomitting(anotherSectionMock);
    verify(nextFilterMock).run(scheduleMock);
  }
コード例 #2
0
  @Test
  public void canSayIfSectionWouldCauseConcomittingCourseConflictWithSchedule() {
    List<Conflict> conflicts = filter.run(scheduleMock, aSectionMock);

    assertEquals(1, conflicts.size());
    verify(aSectionMock).areConcomitting(anotherSectionMock);
    verify(nextFilterMock).run(scheduleMock, aSectionMock);
  }
コード例 #3
0
  @Before
  public void setUp() {
    TimeSlot timeSlotMock = mock(TimeSlot.class);
    when(timeSlotMock.isOverlapping(any(TimeSlot.class))).thenReturn(true);
    List<TimeSlot> timeSlotsMocks = Arrays.asList(timeSlotMock);

    aSectionMock = mock(Section.class);
    anotherSectionMock = mock(Section.class);
    when(aSectionMock.getCourseAcronym()).thenReturn("GLO-4000");
    when(aSectionMock.getCoursesAndLabTimeSlots()).thenReturn(timeSlotsMocks);
    when(aSectionMock.areConcomitting(anotherSectionMock)).thenReturn(true);
    when(anotherSectionMock.getCourseAcronym()).thenReturn("GLO-3000");
    when(anotherSectionMock.getCoursesAndLabTimeSlots()).thenReturn(timeSlotsMocks);
    List<Section> sectionsMocks = Arrays.asList(aSectionMock, anotherSectionMock);

    scheduleMock = mock(Schedule.class);
    when(scheduleMock.getSectionsList()).thenReturn(sectionsMocks);

    nextFilterMock = mock(Filter.class);
    filter = new ConcomittingCoursesFilter();
    filter.connectToFilter(nextFilterMock);
  }