예제 #1
0
  public void testFactory_minutesBetween_RPartial() {
    LocalTime start = new LocalTime(12, 3);
    LocalTime end1 = new LocalTime(12, 6);
    TimeOfDay end2 = new TimeOfDay(12, 9);

    assertEquals(3, Minutes.minutesBetween(start, end1).getMinutes());
    assertEquals(0, Minutes.minutesBetween(start, start).getMinutes());
    assertEquals(0, Minutes.minutesBetween(end1, end1).getMinutes());
    assertEquals(-3, Minutes.minutesBetween(end1, start).getMinutes());
    assertEquals(6, Minutes.minutesBetween(start, end2).getMinutes());
  }
예제 #2
0
  // -----------------------------------------------------------------------
  public void testFactory_minutesBetween_RInstant() {
    DateTime start = new DateTime(2006, 6, 9, 12, 3, 0, 0, PARIS);
    DateTime end1 = new DateTime(2006, 6, 9, 12, 6, 0, 0, PARIS);
    DateTime end2 = new DateTime(2006, 6, 9, 12, 9, 0, 0, PARIS);

    assertEquals(3, Minutes.minutesBetween(start, end1).getMinutes());
    assertEquals(0, Minutes.minutesBetween(start, start).getMinutes());
    assertEquals(0, Minutes.minutesBetween(end1, end1).getMinutes());
    assertEquals(-3, Minutes.minutesBetween(end1, start).getMinutes());
    assertEquals(6, Minutes.minutesBetween(start, end2).getMinutes());
  }