Exemplo n.º 1
0
  public void testLengthNegativeAndPositiveWithGap() throws Exception {
    studySegment.addPeriod(createPeriod("dc", -28, 14, 1));
    studySegment.addPeriod(createPeriod("dc", 10, 8, 2));

    assertDayRange(-28, 25, studySegment.getDayRange());
    assertEquals(54, studySegment.getLengthInDays());
  }
Exemplo n.º 2
0
  public void testLengthNegative() throws Exception {
    Period single = createPeriod("", -28, 15, 1);
    studySegment.addPeriod(single);

    assertDayRange(-28, -14, studySegment.getDayRange());
    assertEquals(15, studySegment.getLengthInDays());
  }
Exemplo n.º 3
0
  public void testLengthSimple() throws Exception {
    Period single = createPeriod("", 3, Duration.Unit.day, 15, 3);
    studySegment.addPeriod(single);

    assertDayRange(3, 47, studySegment.getDayRange());
    assertEquals(45, studySegment.getLengthInDays());
  }
Exemplo n.º 4
0
  public void testLengthWhenOverlapping() throws Exception {
    Period zero = createPeriod("", 1, Duration.Unit.day, 30, 1);
    Period one = createPeriod("", 17, Duration.Unit.day, 15, 1);
    studySegment.addPeriod(zero);
    studySegment.addPeriod(one);

    assertDayRange(1, 31, studySegment.getDayRange());
    assertEquals(31, studySegment.getLengthInDays());
  }