示例#1
0
  @Test
  public void testMultipleStartTimesAndImpossibleLapTime() {
    Time s1 = Time.parse("00.00.05");
    c.addStartTime(s1);
    Time s2 = Time.parse("00.00.06");
    c.addStartTime(s2);
    Time f1 = Time.parse("00.20.06");
    c.addFinishTime(f1);
    Time f2 = Time.parse("00.55.06");
    c.addFinishTime(f2);
    Time f3 = Time.parse("00.57.00");
    c.addFinishTime(f3);

    assertEquals(
        Formater.formatColumns(
            1,
            c.getName(),
            c.getNumberOfLaps(),
            s1.difference(f3),
            s1.difference(f1),
            f1.difference(f2),
            f2.difference(f3),
            s1,
            f1,
            f2,
            f3,
            Printer.MULTIPLE_STARTS + " " + s2,
            Printer.IMPOSSIBLE_LAP_TIME),
        cp.row(c));
  }
示例#2
0
  @Test
  public void testMultipleStartTimes() {
    Time s1 = Time.parse("00.10.00");
    c.addStartTime(s1);
    Time s2 = Time.parse("00.20.00");
    c.addStartTime(s2);
    Time f1 = Time.parse("00.45.00");
    c.addFinishTime(f1);
    Time f2 = Time.parse("01.15.00");
    c.addFinishTime(f2);

    assertEquals(
        Formater.formatColumns(
            1,
            c.getName(),
            c.getNumberOfLaps(),
            s1.difference(f2),
            Time.parse("00.35.00"),
            Time.parse("00.30.00"),
            s1,
            f1,
            f2,
            Printer.MULTIPLE_STARTS + " " + s2),
        cp.row(c));
  }
示例#3
0
 @Test
 public void testBadEnd() {
   Time t1 = Time.parse("00.10.00");
   c.addStartTime(t1);
   assertEquals(
       Formater.formatColumns(
           1, c.getName(), c.getNumberOfLaps(), new NullTime().toString(), t1, Printer.NO_END),
       cp.row(c));
 }
示例#4
0
 @Test
 public void testBadStart() {
   c.addFinishTime(Time.parse("00.45.00"));
   assertEquals(
       Formater.formatColumns(
           1,
           c.getName(),
           c.getNumberOfLaps(),
           new NullTime().toString(),
           "",
           Printer.NO_START,
           Time.parse("00.45.00")),
       cp.row(c));
 }
示例#5
0
  @Test
  public void testImpossibleLapTime() {
    Time s1 = Time.parse("00.00.05");
    c.addStartTime(s1);
    Time f1 = Time.parse("00.25.00");
    c.addFinishTime(f1);
    Time f2 = Time.parse("00.26.00");
    c.addFinishTime(f2);

    assertEquals(
        Formater.formatColumns(
            1,
            c.getName(),
            c.getNumberOfLaps(),
            s1.difference(f2),
            s1.difference(f1),
            f1.difference(f2),
            s1,
            f1,
            f2,
            Printer.IMPOSSIBLE_LAP_TIME),
        cp.row(c));
  }