Ejemplo n.º 1
0
  public void testMinus_RD() {
    DateTime test = new DateTime(TEST_TIME1, BUDDHIST_DEFAULT);
    DateTime result = test.minus(new Duration(123456789L));
    DateTime expected = new DateTime(TEST_TIME1 - 123456789L, BUDDHIST_DEFAULT);
    assertEquals(expected, result);

    result = test.minus((ReadableDuration) null);
    assertSame(test, result);
  }
Ejemplo n.º 2
0
  public void testMinus_RP() {
    DateTime test = new DateTime(2002, 5, 3, 1, 2, 3, 4, BUDDHIST_DEFAULT);
    DateTime result = test.minus(new Period(1, 1, 1, 1, 1, 1, 1, 1));
    DateTime expected = new DateTime(2001, 3, 26, 0, 1, 2, 3, BUDDHIST_DEFAULT);
    assertEquals(expected, result);

    result = test.minus((ReadablePeriod) null);
    assertSame(test, result);
  }
Ejemplo n.º 3
0
 // -----------------------------------------------------------------------
 public void testMinus_long() {
   DateTime test = new DateTime(TEST_TIME1, BUDDHIST_DEFAULT);
   DateTime result = test.minus(123456789L);
   DateTime expected = new DateTime(TEST_TIME1 - 123456789L, BUDDHIST_DEFAULT);
   assertEquals(expected, result);
 }